diff --git a/mocks/mock_db.go b/mocks/mock_db.go index 05b02efdd65..9c2a99658b7 100644 --- a/mocks/mock_db.go +++ b/mocks/mock_db.go @@ -6,37 +6,38 @@ package mocks import ( context "context" + reflect "reflect" + db "github.com/Azure/radius/pkg/curp/db" resources "github.com/Azure/radius/pkg/curp/resources" revision "github.com/Azure/radius/pkg/curp/revision" gomock "github.com/golang/mock/gomock" - reflect "reflect" ) -// MockCurpDB is a mock of CurpDB interface +// MockCurpDB is a mock of CurpDB interface. type MockCurpDB struct { ctrl *gomock.Controller recorder *MockCurpDBMockRecorder } -// MockCurpDBMockRecorder is the mock recorder for MockCurpDB +// MockCurpDBMockRecorder is the mock recorder for MockCurpDB. type MockCurpDBMockRecorder struct { mock *MockCurpDB } -// NewMockCurpDB creates a new mock instance +// NewMockCurpDB creates a new mock instance. func NewMockCurpDB(ctrl *gomock.Controller) *MockCurpDB { mock := &MockCurpDB{ctrl: ctrl} mock.recorder = &MockCurpDBMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockCurpDB) EXPECT() *MockCurpDBMockRecorder { return m.recorder } -// DeleteApplicationByID mocks base method +// DeleteApplicationByID mocks base method. func (m *MockCurpDB) DeleteApplicationByID(arg0 context.Context, arg1 resources.ApplicationID) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteApplicationByID", arg0, arg1) @@ -44,13 +45,13 @@ func (m *MockCurpDB) DeleteApplicationByID(arg0 context.Context, arg1 resources. return ret0 } -// DeleteApplicationByID indicates an expected call of DeleteApplicationByID +// DeleteApplicationByID indicates an expected call of DeleteApplicationByID. func (mr *MockCurpDBMockRecorder) DeleteApplicationByID(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteApplicationByID", reflect.TypeOf((*MockCurpDB)(nil).DeleteApplicationByID), arg0, arg1) } -// DeleteComponentByApplicationID mocks base method +// DeleteComponentByApplicationID mocks base method. func (m *MockCurpDB) DeleteComponentByApplicationID(arg0 context.Context, arg1 resources.ApplicationID, arg2 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteComponentByApplicationID", arg0, arg1, arg2) @@ -58,13 +59,13 @@ func (m *MockCurpDB) DeleteComponentByApplicationID(arg0 context.Context, arg1 r return ret0 } -// DeleteComponentByApplicationID indicates an expected call of DeleteComponentByApplicationID +// DeleteComponentByApplicationID indicates an expected call of DeleteComponentByApplicationID. func (mr *MockCurpDBMockRecorder) DeleteComponentByApplicationID(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteComponentByApplicationID", reflect.TypeOf((*MockCurpDB)(nil).DeleteComponentByApplicationID), arg0, arg1, arg2) } -// DeleteDeploymentByApplicationID mocks base method +// DeleteDeploymentByApplicationID mocks base method. func (m *MockCurpDB) DeleteDeploymentByApplicationID(arg0 context.Context, arg1 resources.ApplicationID, arg2 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteDeploymentByApplicationID", arg0, arg1, arg2) @@ -72,13 +73,13 @@ func (m *MockCurpDB) DeleteDeploymentByApplicationID(arg0 context.Context, arg1 return ret0 } -// DeleteDeploymentByApplicationID indicates an expected call of DeleteDeploymentByApplicationID +// DeleteDeploymentByApplicationID indicates an expected call of DeleteDeploymentByApplicationID. func (mr *MockCurpDBMockRecorder) DeleteDeploymentByApplicationID(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDeploymentByApplicationID", reflect.TypeOf((*MockCurpDB)(nil).DeleteDeploymentByApplicationID), arg0, arg1, arg2) } -// DeleteScopeByApplicationID mocks base method +// DeleteScopeByApplicationID mocks base method. func (m *MockCurpDB) DeleteScopeByApplicationID(arg0 context.Context, arg1 resources.ApplicationID, arg2 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteScopeByApplicationID", arg0, arg1, arg2) @@ -86,13 +87,13 @@ func (m *MockCurpDB) DeleteScopeByApplicationID(arg0 context.Context, arg1 resou return ret0 } -// DeleteScopeByApplicationID indicates an expected call of DeleteScopeByApplicationID +// DeleteScopeByApplicationID indicates an expected call of DeleteScopeByApplicationID. func (mr *MockCurpDBMockRecorder) DeleteScopeByApplicationID(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteScopeByApplicationID", reflect.TypeOf((*MockCurpDB)(nil).DeleteScopeByApplicationID), arg0, arg1, arg2) } -// GetApplicationByID mocks base method +// GetApplicationByID mocks base method. func (m *MockCurpDB) GetApplicationByID(arg0 context.Context, arg1 resources.ApplicationID) (*db.Application, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetApplicationByID", arg0, arg1) @@ -101,13 +102,13 @@ func (m *MockCurpDB) GetApplicationByID(arg0 context.Context, arg1 resources.App return ret0, ret1 } -// GetApplicationByID indicates an expected call of GetApplicationByID +// GetApplicationByID indicates an expected call of GetApplicationByID. func (mr *MockCurpDBMockRecorder) GetApplicationByID(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetApplicationByID", reflect.TypeOf((*MockCurpDB)(nil).GetApplicationByID), arg0, arg1) } -// GetComponentByApplicationID mocks base method +// GetComponentByApplicationID mocks base method. func (m *MockCurpDB) GetComponentByApplicationID(arg0 context.Context, arg1 resources.ApplicationID, arg2 string, arg3 revision.Revision) (*db.Component, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetComponentByApplicationID", arg0, arg1, arg2, arg3) @@ -116,13 +117,13 @@ func (m *MockCurpDB) GetComponentByApplicationID(arg0 context.Context, arg1 reso return ret0, ret1 } -// GetComponentByApplicationID indicates an expected call of GetComponentByApplicationID +// GetComponentByApplicationID indicates an expected call of GetComponentByApplicationID. func (mr *MockCurpDBMockRecorder) GetComponentByApplicationID(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetComponentByApplicationID", reflect.TypeOf((*MockCurpDB)(nil).GetComponentByApplicationID), arg0, arg1, arg2, arg3) } -// GetDeploymentByApplicationID mocks base method +// GetDeploymentByApplicationID mocks base method. func (m *MockCurpDB) GetDeploymentByApplicationID(arg0 context.Context, arg1 resources.ApplicationID, arg2 string) (*db.Deployment, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetDeploymentByApplicationID", arg0, arg1, arg2) @@ -131,13 +132,13 @@ func (m *MockCurpDB) GetDeploymentByApplicationID(arg0 context.Context, arg1 res return ret0, ret1 } -// GetDeploymentByApplicationID indicates an expected call of GetDeploymentByApplicationID +// GetDeploymentByApplicationID indicates an expected call of GetDeploymentByApplicationID. func (mr *MockCurpDBMockRecorder) GetDeploymentByApplicationID(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDeploymentByApplicationID", reflect.TypeOf((*MockCurpDB)(nil).GetDeploymentByApplicationID), arg0, arg1, arg2) } -// GetScopeByApplicationID mocks base method +// GetScopeByApplicationID mocks base method. func (m *MockCurpDB) GetScopeByApplicationID(arg0 context.Context, arg1 resources.ApplicationID, arg2 string) (*db.Scope, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetScopeByApplicationID", arg0, arg1, arg2) @@ -146,13 +147,13 @@ func (m *MockCurpDB) GetScopeByApplicationID(arg0 context.Context, arg1 resource return ret0, ret1 } -// GetScopeByApplicationID indicates an expected call of GetScopeByApplicationID +// GetScopeByApplicationID indicates an expected call of GetScopeByApplicationID. func (mr *MockCurpDBMockRecorder) GetScopeByApplicationID(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetScopeByApplicationID", reflect.TypeOf((*MockCurpDB)(nil).GetScopeByApplicationID), arg0, arg1, arg2) } -// ListApplicationsByResourceGroup mocks base method +// ListApplicationsByResourceGroup mocks base method. func (m *MockCurpDB) ListApplicationsByResourceGroup(arg0 context.Context, arg1 resources.ResourceID) ([]db.Application, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListApplicationsByResourceGroup", arg0, arg1) @@ -161,13 +162,13 @@ func (m *MockCurpDB) ListApplicationsByResourceGroup(arg0 context.Context, arg1 return ret0, ret1 } -// ListApplicationsByResourceGroup indicates an expected call of ListApplicationsByResourceGroup +// ListApplicationsByResourceGroup indicates an expected call of ListApplicationsByResourceGroup. func (mr *MockCurpDBMockRecorder) ListApplicationsByResourceGroup(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListApplicationsByResourceGroup", reflect.TypeOf((*MockCurpDB)(nil).ListApplicationsByResourceGroup), arg0, arg1) } -// ListComponentsByApplicationID mocks base method +// ListComponentsByApplicationID mocks base method. func (m *MockCurpDB) ListComponentsByApplicationID(arg0 context.Context, arg1 resources.ApplicationID) ([]db.Component, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListComponentsByApplicationID", arg0, arg1) @@ -176,13 +177,13 @@ func (m *MockCurpDB) ListComponentsByApplicationID(arg0 context.Context, arg1 re return ret0, ret1 } -// ListComponentsByApplicationID indicates an expected call of ListComponentsByApplicationID +// ListComponentsByApplicationID indicates an expected call of ListComponentsByApplicationID. func (mr *MockCurpDBMockRecorder) ListComponentsByApplicationID(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListComponentsByApplicationID", reflect.TypeOf((*MockCurpDB)(nil).ListComponentsByApplicationID), arg0, arg1) } -// ListDeploymentsByApplicationID mocks base method +// ListDeploymentsByApplicationID mocks base method. func (m *MockCurpDB) ListDeploymentsByApplicationID(arg0 context.Context, arg1 resources.ApplicationID) ([]db.Deployment, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListDeploymentsByApplicationID", arg0, arg1) @@ -191,13 +192,13 @@ func (m *MockCurpDB) ListDeploymentsByApplicationID(arg0 context.Context, arg1 r return ret0, ret1 } -// ListDeploymentsByApplicationID indicates an expected call of ListDeploymentsByApplicationID +// ListDeploymentsByApplicationID indicates an expected call of ListDeploymentsByApplicationID. func (mr *MockCurpDBMockRecorder) ListDeploymentsByApplicationID(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListDeploymentsByApplicationID", reflect.TypeOf((*MockCurpDB)(nil).ListDeploymentsByApplicationID), arg0, arg1) } -// ListScopesByApplicationID mocks base method +// ListScopesByApplicationID mocks base method. func (m *MockCurpDB) ListScopesByApplicationID(arg0 context.Context, arg1 resources.ApplicationID) ([]db.Scope, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListScopesByApplicationID", arg0, arg1) @@ -206,13 +207,13 @@ func (m *MockCurpDB) ListScopesByApplicationID(arg0 context.Context, arg1 resour return ret0, ret1 } -// ListScopesByApplicationID indicates an expected call of ListScopesByApplicationID +// ListScopesByApplicationID indicates an expected call of ListScopesByApplicationID. func (mr *MockCurpDBMockRecorder) ListScopesByApplicationID(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListScopesByApplicationID", reflect.TypeOf((*MockCurpDB)(nil).ListScopesByApplicationID), arg0, arg1) } -// PatchApplication mocks base method +// PatchApplication mocks base method. func (m *MockCurpDB) PatchApplication(arg0 context.Context, arg1 *db.ApplicationPatch) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "PatchApplication", arg0, arg1) @@ -220,13 +221,13 @@ func (m *MockCurpDB) PatchApplication(arg0 context.Context, arg1 *db.Application return ret0 } -// PatchApplication indicates an expected call of PatchApplication +// PatchApplication indicates an expected call of PatchApplication. func (mr *MockCurpDBMockRecorder) PatchApplication(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchApplication", reflect.TypeOf((*MockCurpDB)(nil).PatchApplication), arg0, arg1) } -// PatchComponentByApplicationID mocks base method +// PatchComponentByApplicationID mocks base method. func (m *MockCurpDB) PatchComponentByApplicationID(arg0 context.Context, arg1 resources.ApplicationID, arg2 string, arg3 *db.Component, arg4 revision.Revision) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "PatchComponentByApplicationID", arg0, arg1, arg2, arg3, arg4) @@ -234,13 +235,13 @@ func (m *MockCurpDB) PatchComponentByApplicationID(arg0 context.Context, arg1 re return ret0 } -// PatchComponentByApplicationID indicates an expected call of PatchComponentByApplicationID +// PatchComponentByApplicationID indicates an expected call of PatchComponentByApplicationID. func (mr *MockCurpDBMockRecorder) PatchComponentByApplicationID(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchComponentByApplicationID", reflect.TypeOf((*MockCurpDB)(nil).PatchComponentByApplicationID), arg0, arg1, arg2, arg3, arg4) } -// PatchDeploymentByApplicationID mocks base method +// PatchDeploymentByApplicationID mocks base method. func (m *MockCurpDB) PatchDeploymentByApplicationID(arg0 context.Context, arg1 resources.ApplicationID, arg2 string, arg3 *db.Deployment) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "PatchDeploymentByApplicationID", arg0, arg1, arg2, arg3) @@ -248,13 +249,13 @@ func (m *MockCurpDB) PatchDeploymentByApplicationID(arg0 context.Context, arg1 r return ret0 } -// PatchDeploymentByApplicationID indicates an expected call of PatchDeploymentByApplicationID +// PatchDeploymentByApplicationID indicates an expected call of PatchDeploymentByApplicationID. func (mr *MockCurpDBMockRecorder) PatchDeploymentByApplicationID(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchDeploymentByApplicationID", reflect.TypeOf((*MockCurpDB)(nil).PatchDeploymentByApplicationID), arg0, arg1, arg2, arg3) } -// PatchScopeByApplicationID mocks base method +// PatchScopeByApplicationID mocks base method. func (m *MockCurpDB) PatchScopeByApplicationID(arg0 context.Context, arg1 resources.ApplicationID, arg2 string, arg3 *db.Scope) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "PatchScopeByApplicationID", arg0, arg1, arg2, arg3) @@ -262,7 +263,7 @@ func (m *MockCurpDB) PatchScopeByApplicationID(arg0 context.Context, arg1 resour return ret0 } -// PatchScopeByApplicationID indicates an expected call of PatchScopeByApplicationID +// PatchScopeByApplicationID indicates an expected call of PatchScopeByApplicationID. func (mr *MockCurpDBMockRecorder) PatchScopeByApplicationID(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchScopeByApplicationID", reflect.TypeOf((*MockCurpDB)(nil).PatchScopeByApplicationID), arg0, arg1, arg2, arg3) diff --git a/mocks/mock_k8s.go b/mocks/mock_k8s.go index baf13d990da..3c2e7852ffd 100644 --- a/mocks/mock_k8s.go +++ b/mocks/mock_k8s.go @@ -6,38 +6,39 @@ package mocks import ( context "context" + reflect "reflect" + gomock "github.com/golang/mock/gomock" meta "k8s.io/apimachinery/pkg/api/meta" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" - reflect "reflect" client "sigs.k8s.io/controller-runtime/pkg/client" ) -// MockClient is a mock of Client interface +// MockClient is a mock of Client interface. type MockClient struct { ctrl *gomock.Controller recorder *MockClientMockRecorder } -// MockClientMockRecorder is the mock recorder for MockClient +// MockClientMockRecorder is the mock recorder for MockClient. type MockClientMockRecorder struct { mock *MockClient } -// NewMockClient creates a new mock instance +// NewMockClient creates a new mock instance. func NewMockClient(ctrl *gomock.Controller) *MockClient { mock := &MockClient{ctrl: ctrl} mock.recorder = &MockClientMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockClient) EXPECT() *MockClientMockRecorder { return m.recorder } -// Create mocks base method +// Create mocks base method. func (m *MockClient) Create(arg0 context.Context, arg1 client.Object, arg2 ...client.CreateOption) error { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -49,14 +50,14 @@ func (m *MockClient) Create(arg0 context.Context, arg1 client.Object, arg2 ...cl return ret0 } -// Create indicates an expected call of Create +// Create indicates an expected call of Create. func (mr *MockClientMockRecorder) Create(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockClient)(nil).Create), varargs...) } -// Delete mocks base method +// Delete mocks base method. func (m *MockClient) Delete(arg0 context.Context, arg1 client.Object, arg2 ...client.DeleteOption) error { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -68,14 +69,14 @@ func (m *MockClient) Delete(arg0 context.Context, arg1 client.Object, arg2 ...cl return ret0 } -// Delete indicates an expected call of Delete +// Delete indicates an expected call of Delete. func (mr *MockClientMockRecorder) Delete(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockClient)(nil).Delete), varargs...) } -// DeleteAllOf mocks base method +// DeleteAllOf mocks base method. func (m *MockClient) DeleteAllOf(arg0 context.Context, arg1 client.Object, arg2 ...client.DeleteAllOfOption) error { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -87,14 +88,14 @@ func (m *MockClient) DeleteAllOf(arg0 context.Context, arg1 client.Object, arg2 return ret0 } -// DeleteAllOf indicates an expected call of DeleteAllOf +// DeleteAllOf indicates an expected call of DeleteAllOf. func (mr *MockClientMockRecorder) DeleteAllOf(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOf", reflect.TypeOf((*MockClient)(nil).DeleteAllOf), varargs...) } -// Get mocks base method +// Get mocks base method. func (m *MockClient) Get(arg0 context.Context, arg1 types.NamespacedName, arg2 client.Object) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Get", arg0, arg1, arg2) @@ -102,13 +103,13 @@ func (m *MockClient) Get(arg0 context.Context, arg1 types.NamespacedName, arg2 c return ret0 } -// Get indicates an expected call of Get +// Get indicates an expected call of Get. func (mr *MockClientMockRecorder) Get(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockClient)(nil).Get), arg0, arg1, arg2) } -// List mocks base method +// List mocks base method. func (m *MockClient) List(arg0 context.Context, arg1 client.ObjectList, arg2 ...client.ListOption) error { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -120,14 +121,14 @@ func (m *MockClient) List(arg0 context.Context, arg1 client.ObjectList, arg2 ... return ret0 } -// List indicates an expected call of List +// List indicates an expected call of List. func (mr *MockClientMockRecorder) List(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockClient)(nil).List), varargs...) } -// Patch mocks base method +// Patch mocks base method. func (m *MockClient) Patch(arg0 context.Context, arg1 client.Object, arg2 client.Patch, arg3 ...client.PatchOption) error { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1, arg2} @@ -139,14 +140,14 @@ func (m *MockClient) Patch(arg0 context.Context, arg1 client.Object, arg2 client return ret0 } -// Patch indicates an expected call of Patch +// Patch indicates an expected call of Patch. func (mr *MockClientMockRecorder) Patch(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Patch", reflect.TypeOf((*MockClient)(nil).Patch), varargs...) } -// RESTMapper mocks base method +// RESTMapper mocks base method. func (m *MockClient) RESTMapper() meta.RESTMapper { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RESTMapper") @@ -154,13 +155,13 @@ func (m *MockClient) RESTMapper() meta.RESTMapper { return ret0 } -// RESTMapper indicates an expected call of RESTMapper +// RESTMapper indicates an expected call of RESTMapper. func (mr *MockClientMockRecorder) RESTMapper() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RESTMapper", reflect.TypeOf((*MockClient)(nil).RESTMapper)) } -// Scheme mocks base method +// Scheme mocks base method. func (m *MockClient) Scheme() *runtime.Scheme { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Scheme") @@ -168,13 +169,13 @@ func (m *MockClient) Scheme() *runtime.Scheme { return ret0 } -// Scheme indicates an expected call of Scheme +// Scheme indicates an expected call of Scheme. func (mr *MockClientMockRecorder) Scheme() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Scheme", reflect.TypeOf((*MockClient)(nil).Scheme)) } -// Status mocks base method +// Status mocks base method. func (m *MockClient) Status() client.StatusWriter { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Status") @@ -182,13 +183,13 @@ func (m *MockClient) Status() client.StatusWriter { return ret0 } -// Status indicates an expected call of Status +// Status indicates an expected call of Status. func (mr *MockClientMockRecorder) Status() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Status", reflect.TypeOf((*MockClient)(nil).Status)) } -// Update mocks base method +// Update mocks base method. func (m *MockClient) Update(arg0 context.Context, arg1 client.Object, arg2 ...client.UpdateOption) error { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -200,7 +201,7 @@ func (m *MockClient) Update(arg0 context.Context, arg1 client.Object, arg2 ...cl return ret0 } -// Update indicates an expected call of Update +// Update indicates an expected call of Update. func (mr *MockClientMockRecorder) Update(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) diff --git a/pkg/radclient/zz_generated_component.go b/pkg/radclient/zz_generated_component.go new file mode 100644 index 00000000000..6c5cc5f96ad --- /dev/null +++ b/pkg/radclient/zz_generated_component.go @@ -0,0 +1,179 @@ +// +build go1.13 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project 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. + +package radclient + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/armcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "net/http" + "net/url" + "strings" +) + +// ComponentClient contains the methods for the Component group. +// Don't use this type directly, use NewComponentClient() instead. +type ComponentClient struct { + con *armcore.Connection + subscriptionID string +} + +// NewComponentClient creates a new instance of ComponentClient with the specified values. +func NewComponentClient(con *armcore.Connection, subscriptionID string) *ComponentClient { + return &ComponentClient{con: con, subscriptionID: subscriptionID} +} + +// Delete - Deletes a component. +func (client *ComponentClient) Delete(ctx context.Context, resourceGroupName string, applicationName string, componentName string, options *ComponentDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, applicationName, componentName, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusNoContent) { + return nil, client.deleteHandleError(resp) + } + return resp.Response, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ComponentClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationName string, componentName string, options *ComponentDeleteOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/{applicationName}/Components/{componentName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + urlPath = strings.ReplaceAll(urlPath, "{applicationName}", url.PathEscape(applicationName)) + urlPath = strings.ReplaceAll(urlPath, "{componentName}", url.PathEscape(componentName)) + req, err := azcore.NewRequest(ctx, http.MethodDelete, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + query := req.URL.Query() + query.Set("api-version", "2018-09-01-preview") + req.URL.RawQuery = query.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHandleError handles the Delete error response. +func (client *ComponentClient) deleteHandleError(resp *azcore.Response) error { +var err ErrorResponse + if err := resp.UnmarshalAsJSON(&err); err != nil { + return err + } + return azcore.NewResponseError(&err, resp.Response) +} + +// Get - Gets a component by name. +func (client *ComponentClient) Get(ctx context.Context, resourceGroupName string, applicationName string, componentName string, options *ComponentGetOptions) (ComponentResourceResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, applicationName, componentName, options) + if err != nil { + return ComponentResourceResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return ComponentResourceResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return ComponentResourceResponse{}, client.getHandleError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ComponentClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationName string, componentName string, options *ComponentGetOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/{applicationName}/Components/{componentName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + urlPath = strings.ReplaceAll(urlPath, "{applicationName}", url.PathEscape(applicationName)) + urlPath = strings.ReplaceAll(urlPath, "{componentName}", url.PathEscape(componentName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + query := req.URL.Query() + query.Set("api-version", "2018-09-01-preview") + req.URL.RawQuery = query.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ComponentClient) getHandleResponse(resp *azcore.Response) (ComponentResourceResponse, error) { + var val *ComponentResource + if err := resp.UnmarshalAsJSON(&val); err != nil { + return ComponentResourceResponse{}, err + } +return ComponentResourceResponse{RawResponse: resp.Response, ComponentResource: val}, nil +} + +// getHandleError handles the Get error response. +func (client *ComponentClient) getHandleError(resp *azcore.Response) error { +var err ErrorResponse + if err := resp.UnmarshalAsJSON(&err); err != nil { + return err + } + return azcore.NewResponseError(&err, resp.Response) +} + +// ListByApplication - List components deployed in the application. +func (client *ComponentClient) ListByApplication(ctx context.Context, resourceGroupName string, applicationName string, options *ComponentListByApplicationOptions) (ComponentListResponse, error) { + req, err := client.listByApplicationCreateRequest(ctx, resourceGroupName, applicationName, options) + if err != nil { + return ComponentListResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return ComponentListResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return ComponentListResponse{}, client.listByApplicationHandleError(resp) + } + return client.listByApplicationHandleResponse(resp) +} + +// listByApplicationCreateRequest creates the ListByApplication request. +func (client *ComponentClient) listByApplicationCreateRequest(ctx context.Context, resourceGroupName string, applicationName string, options *ComponentListByApplicationOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/{applicationName}/Components" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + urlPath = strings.ReplaceAll(urlPath, "{applicationName}", url.PathEscape(applicationName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + query := req.URL.Query() + query.Set("api-version", "2018-09-01-preview") + req.URL.RawQuery = query.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// listByApplicationHandleResponse handles the ListByApplication response. +func (client *ComponentClient) listByApplicationHandleResponse(resp *azcore.Response) (ComponentListResponse, error) { + var val *ComponentList + if err := resp.UnmarshalAsJSON(&val); err != nil { + return ComponentListResponse{}, err + } +return ComponentListResponse{RawResponse: resp.Response, ComponentList: val}, nil +} + +// listByApplicationHandleError handles the ListByApplication error response. +func (client *ComponentClient) listByApplicationHandleError(resp *azcore.Response) error { +var err ErrorResponse + if err := resp.UnmarshalAsJSON(&err); err != nil { + return err + } + return azcore.NewResponseError(&err, resp.Response) +} + diff --git a/pkg/radclient/zz_generated_deployment.go b/pkg/radclient/zz_generated_deployment.go new file mode 100644 index 00000000000..3d0e8646801 --- /dev/null +++ b/pkg/radclient/zz_generated_deployment.go @@ -0,0 +1,179 @@ +// +build go1.13 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project 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. + +package radclient + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/armcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "net/http" + "net/url" + "strings" +) + +// DeploymentClient contains the methods for the Deployment group. +// Don't use this type directly, use NewDeploymentClient() instead. +type DeploymentClient struct { + con *armcore.Connection + subscriptionID string +} + +// NewDeploymentClient creates a new instance of DeploymentClient with the specified values. +func NewDeploymentClient(con *armcore.Connection, subscriptionID string) *DeploymentClient { + return &DeploymentClient{con: con, subscriptionID: subscriptionID} +} + +// Delete - Deletes a deployment. +func (client *DeploymentClient) Delete(ctx context.Context, resourceGroupName string, applicationName string, deploymentName string, options *DeploymentDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, applicationName, deploymentName, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusNoContent) { + return nil, client.deleteHandleError(resp) + } + return resp.Response, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DeploymentClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationName string, deploymentName string, options *DeploymentDeleteOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/{applicationName}/Deployments/{deploymentName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + urlPath = strings.ReplaceAll(urlPath, "{applicationName}", url.PathEscape(applicationName)) + urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName)) + req, err := azcore.NewRequest(ctx, http.MethodDelete, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + query := req.URL.Query() + query.Set("api-version", "2018-09-01-preview") + req.URL.RawQuery = query.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHandleError handles the Delete error response. +func (client *DeploymentClient) deleteHandleError(resp *azcore.Response) error { +var err ErrorResponse + if err := resp.UnmarshalAsJSON(&err); err != nil { + return err + } + return azcore.NewResponseError(&err, resp.Response) +} + +// Get - Gets a deployment by name. +func (client *DeploymentClient) Get(ctx context.Context, resourceGroupName string, applicationName string, deploymentName string, options *DeploymentGetOptions) (DeploymentResourceResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, applicationName, deploymentName, options) + if err != nil { + return DeploymentResourceResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return DeploymentResourceResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return DeploymentResourceResponse{}, client.getHandleError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DeploymentClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationName string, deploymentName string, options *DeploymentGetOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/{applicationName}/Deployments/{deploymentName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + urlPath = strings.ReplaceAll(urlPath, "{applicationName}", url.PathEscape(applicationName)) + urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + query := req.URL.Query() + query.Set("api-version", "2018-09-01-preview") + req.URL.RawQuery = query.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DeploymentClient) getHandleResponse(resp *azcore.Response) (DeploymentResourceResponse, error) { + var val *DeploymentResource + if err := resp.UnmarshalAsJSON(&val); err != nil { + return DeploymentResourceResponse{}, err + } +return DeploymentResourceResponse{RawResponse: resp.Response, DeploymentResource: val}, nil +} + +// getHandleError handles the Get error response. +func (client *DeploymentClient) getHandleError(resp *azcore.Response) error { +var err ErrorResponse + if err := resp.UnmarshalAsJSON(&err); err != nil { + return err + } + return azcore.NewResponseError(&err, resp.Response) +} + +// ListByApplication - List all the deployments for an application in the resource group. +func (client *DeploymentClient) ListByApplication(ctx context.Context, resourceGroupName string, applicationName string, options *DeploymentListByApplicationOptions) (DeploymentListResponse, error) { + req, err := client.listByApplicationCreateRequest(ctx, resourceGroupName, applicationName, options) + if err != nil { + return DeploymentListResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return DeploymentListResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return DeploymentListResponse{}, client.listByApplicationHandleError(resp) + } + return client.listByApplicationHandleResponse(resp) +} + +// listByApplicationCreateRequest creates the ListByApplication request. +func (client *DeploymentClient) listByApplicationCreateRequest(ctx context.Context, resourceGroupName string, applicationName string, options *DeploymentListByApplicationOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/{applicationName}/Deployments" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + urlPath = strings.ReplaceAll(urlPath, "{applicationName}", url.PathEscape(applicationName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + query := req.URL.Query() + query.Set("api-version", "2018-09-01-preview") + req.URL.RawQuery = query.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// listByApplicationHandleResponse handles the ListByApplication response. +func (client *DeploymentClient) listByApplicationHandleResponse(resp *azcore.Response) (DeploymentListResponse, error) { + var val *DeploymentList + if err := resp.UnmarshalAsJSON(&val); err != nil { + return DeploymentListResponse{}, err + } +return DeploymentListResponse{RawResponse: resp.Response, DeploymentList: val}, nil +} + +// listByApplicationHandleError handles the ListByApplication error response. +func (client *DeploymentClient) listByApplicationHandleError(resp *azcore.Response) error { +var err ErrorResponse + if err := resp.UnmarshalAsJSON(&err); err != nil { + return err + } + return azcore.NewResponseError(&err, resp.Response) +} + diff --git a/pkg/radclient/zz_generated_models.go b/pkg/radclient/zz_generated_models.go index 93b4eed69ba..7d86fdf3024 100644 --- a/pkg/radclient/zz_generated_models.go +++ b/pkg/radclient/zz_generated_models.go @@ -69,6 +69,115 @@ type ApplicationResourceResponse struct { RawResponse *http.Response } +// ComponentDeleteOptions contains the optional parameters for the Component.Delete method. +type ComponentDeleteOptions struct { + // placeholder for future optional parameters +} + +// ComponentGetOptions contains the optional parameters for the Component.Get method. +type ComponentGetOptions struct { + // placeholder for future optional parameters +} + +// Component list. +type ComponentList struct { + // List of components. + Value *[]ComponentResource `json:"value,omitempty"` +} + +// ComponentListByApplicationOptions contains the optional parameters for the Component.ListByApplication method. +type ComponentListByApplicationOptions struct { + // placeholder for future optional parameters +} + +// ComponentListResponse is the response envelope for operations that return a ComponentList type. +type ComponentListResponse struct { + // Component list. + ComponentList *ComponentList + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// Properties of a component. +type ComponentProperties struct { + // Resource type of the component + Kind *string `json:"kind,omitempty"` +} + +// Component resource. +type ComponentResource struct { + TrackedResource + // Properties of the component. + Properties *ComponentProperties `json:"properties,omitempty"` +} + +// ComponentResourceResponse is the response envelope for operations that return a ComponentResource type. +type ComponentResourceResponse struct { + // Component resource. + ComponentResource *ComponentResource + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DeploymentDeleteOptions contains the optional parameters for the Deployment.Delete method. +type DeploymentDeleteOptions struct { + // placeholder for future optional parameters +} + +// DeploymentGetOptions contains the optional parameters for the Deployment.Get method. +type DeploymentGetOptions struct { + // placeholder for future optional parameters +} + +// Deployment list. +type DeploymentList struct { + // List of deployments. + Value *[]DeploymentResource `json:"value,omitempty"` +} + +// DeploymentListByApplicationOptions contains the optional parameters for the Deployment.ListByApplication method. +type DeploymentListByApplicationOptions struct { + // placeholder for future optional parameters +} + +// DeploymentListResponse is the response envelope for operations that return a DeploymentList type. +type DeploymentListResponse struct { + // Deployment list. + DeploymentList *DeploymentList + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// Properties of a deployment. +type DeploymentProperties struct { + // List of components in the deployment. + Components *[]DeploymentPropertiesComponentsItem `json:"components,omitempty"` +} + +type DeploymentPropertiesComponentsItem struct { + // Name of the component + ComponentName *string `json:"componentName,omitempty"` +} + +// Deployment resource. +type DeploymentResource struct { + TrackedResource + // Properties of the deployment. + Properties *DeploymentProperties `json:"properties,omitempty"` +} + +// DeploymentResourceResponse is the response envelope for operations that return a DeploymentResource type. +type DeploymentResourceResponse struct { + // Deployment resource. + DeploymentResource *DeploymentResource + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + // The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. diff --git a/schemas/rest-api-specs/radius.json b/schemas/rest-api-specs/radius.json index 9f453a2fc20..5eca0a94c04 100644 --- a/schemas/rest-api-specs/radius.json +++ b/schemas/rest-api-specs/radius.json @@ -181,6 +181,230 @@ } } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/{applicationName}/Deployments": { + "get": { + "operationId": "Deployment_ListByApplication", + "tags": [ + "Deployment" + ], + "description": "List all the deployments for an application in the resource group.", + "parameters": [ + { + "$ref": "common-types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "common-types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApplicationNameParameter" + }, + { + "$ref": "common-types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The list of deployments was retrieved successfully.", + "schema": { + "$ref": "#/definitions/DeploymentList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/{applicationName}/Deployments/{deploymentName}": { + "get": { + "operationId": "Deployment_Get", + "tags": [ + "Deployment" + ], + "description": "Gets a deployment by name.", + "parameters": [ + { + "$ref": "common-types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "common-types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApplicationNameParameter" + }, + { + "$ref": "#/parameters/DeploymentNameParameter" + }, + { + "$ref": "common-types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The deployment was retrieved successfully.", + "schema": { + "$ref": "#/definitions/DeploymentResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "operationId": "Deployment_Delete", + "tags": [ + "Deployment" + ], + "description": "Deletes a deployment.", + "parameters": [ + { + "$ref": "common-types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "common-types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApplicationNameParameter" + }, + { + "$ref": "#/parameters/DeploymentNameParameter" + }, + { + "$ref": "common-types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "204": { + "description": "The deployment was successfully deleted." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/{applicationName}/Components": { + "get": { + "operationId": "Component_ListByApplication", + "tags": [ + "Component" + ], + "description": "List components deployed in the application.", + "parameters": [ + { + "$ref": "common-types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "common-types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApplicationNameParameter" + }, + { + "$ref": "common-types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The list of applications was retrieved successfully.", + "schema": { + "$ref": "#/definitions/ComponentList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/{applicationName}/Components/{componentName}": { + "get": { + "operationId": "Component_Get", + "tags": [ + "Component" + ], + "description": "Gets a component by name.", + "parameters": [ + { + "$ref": "common-types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "common-types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApplicationNameParameter" + }, + { + "$ref": "#/parameters/ComponentNameParameter" + }, + { + "$ref": "common-types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The application was retrieved successfully.", + "schema": { + "$ref": "#/definitions/ComponentResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "operationId": "Component_Delete", + "tags": [ + "Component" + ], + "description": "Deletes a component.", + "parameters": [ + { + "$ref": "common-types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "common-types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApplicationNameParameter" + }, + { + "$ref": "#/parameters/ComponentNameParameter" + }, + { + "$ref": "common-types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "204": { + "description": "The component was successfully deleted." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + } + } } }, "definitions": { @@ -242,6 +466,124 @@ "ApplicationCreateProperties": { "description": "Properties used to create an application.", "type": "object" + }, + "DeploymentList": { + "description": "Deployment list.", + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "array", + "description": "List of deployments.", + "items": { + "$ref": "#/definitions/DeploymentResource" + } + } + } + }, + "DeploymentResource": { + "description": "Deployment resource.", + "type": "object", + "x-ms-azure-resource": true, + "allOf": [ + { + "$ref": "common-types.json#/definitions/TrackedResource" + } + ], + "required": [ + "name", + "properties" + ], + "properties": { + "name": { + "description": "Defines the name of the deployment.", + "type": "string" + }, + "properties": { + "type": "object", + "$ref": "#/definitions/DeploymentProperties", + "description": "Properties of the deployment." + } + } + }, + "DeploymentProperties": { + "description": "Properties of a deployment.", + "type": "object", + "required": [ + "components" + ], + "properties": { + "components": { + "type": "array", + "description": "List of components in the deployment.", + "items": { + "type": "object", + "required": [ + "componentName" + ], + "properties": { + "componentName": { + "type": "string", + "description": "Name of the component" + } + } + } + } + } + }, + "ComponentList": { + "description": "Component list.", + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "array", + "description": "List of components.", + "items": { + "$ref": "#/definitions/ComponentResource" + } + } + } + }, + "ComponentResource": { + "description": "Component resource.", + "type": "object", + "x-ms-azure-resource": true, + "allOf": [ + { + "$ref": "common-types.json#/definitions/TrackedResource" + } + ], + "required": [ + "name", + "kind", + "properties" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the component." + }, + "kind": { + "type": "string", + "description": "Resource type of the component" + }, + "properties": { + "type": "object", + "$ref": "#/definitions/ComponentProperties", + "description": "Properties of the component." + } + } + }, + "ComponentProperties": { + "description": "Properties of a component.", + "type": "object", + "properties": { + } } }, "parameters": { @@ -252,6 +594,22 @@ "type": "string", "description": "The application name.", "x-ms-parameter-location": "method" + }, + "DeploymentNameParameter": { + "name": "deploymentName", + "in": "path", + "required": true, + "type": "string", + "description": "The deployment name.", + "x-ms-parameter-location": "method" + }, + "ComponentNameParameter": { + "name": "componentName", + "in": "path", + "required": true, + "type": "string", + "description": "The component name.", + "x-ms-parameter-location": "method" } } }