Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track2 sdk: expose get option in fileshareclient #7982

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pkg/azclient/fileshareclient/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,19 @@ func (client *Client) List(ctx context.Context, resourceGroupName string, accoun
}
return result, nil
}

const GetOperationName = "FileSharesClient.Get"

// Get gets the FileShare
func (client *Client) Get(ctx context.Context, resourceGroupName string, accountName string, fileshareName string, option *armstorage.FileSharesClientGetOptions) (result *armstorage.FileShare, err error) {
metricsCtx := metrics.BeginARMRequest(client.subscriptionID, resourceGroupName, "FileShare", "get")
defer func() { metricsCtx.Observe(ctx, err) }()
ctx, endSpan := runtime.StartSpan(ctx, GetOperationName, client.tracer, nil)
defer endSpan(err)
resp, err := client.FileSharesClient.Get(ctx, resourceGroupName, accountName, fileshareName, option)
if err != nil {
return nil, err
}
//handle statuscode
return &resp.FileShare, nil
}
14 changes: 14 additions & 0 deletions pkg/azclient/fileshareclient/custom_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions pkg/azclient/fileshareclient/fileshareclient_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions pkg/azclient/fileshareclient/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ import (
"context"

armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"

"sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils"
)

// +azure:client:verbs=get,resource=Account,subResource=FileShare,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage,packageAlias=armstorage,clientName=FileSharesClient,expand=true,crossSubFactory=true
// +azure:client:resource=Account,subResource=FileShare,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage,packageAlias=armstorage,clientName=FileSharesClient,expand=true,crossSubFactory=true
type Interface interface {
utils.SubResourceGetWithExpandFunc[armstorage.FileShare]
Get(ctx context.Context, resourceGroupName string, accountName string, resourceName string, option *armstorage.FileSharesClientGetOptions) (result *armstorage.FileShare, rerr error)
List(ctx context.Context, resourceGroupName string, accountName string, option *armstorage.FileSharesClientListOptions) (result []*armstorage.FileShareItem, err error)
Create(ctx context.Context, resourceGroupName string, resourceName string, parentResourceName string, resource armstorage.FileShare, expand *string) (*armstorage.FileShare, error)
Update(ctx context.Context, resourceGroupName string, resourceName string, parentResourceName string, resource armstorage.FileShare) (*armstorage.FileShare, error)
Expand Down
12 changes: 6 additions & 6 deletions pkg/azclient/fileshareclient/mock_fileshareclient/interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 0 additions & 24 deletions pkg/azclient/fileshareclient/zz_generated_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading