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

chore: Deprecate ambiguous API method names and provide non-ambiguous method names #3071

Closed
wants to merge 6 commits into from
Closed
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
87 changes: 44 additions & 43 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
"tags": [
"ApplicationService"
],
"summary": "List returns list of applications",
"operationId": "ListMixin8",
"summary": "ListApplications returns list of applications",
"operationId": "ListApplications",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -134,8 +134,8 @@
"tags": [
"ApplicationService"
],
"summary": "Create creates an application",
"operationId": "CreateMixin8",
"summary": "CreateApplication creates an application",
"operationId": "CreateApplication",
"parameters": [
{
"name": "body",
Expand All @@ -161,8 +161,8 @@
"tags": [
"ApplicationService"
],
"summary": "Update updates an application",
"operationId": "UpdateMixin8",
"summary": "UpdateApplication updates an application",
"operationId": "UpdateApplication",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -292,8 +292,8 @@
"tags": [
"ApplicationService"
],
"summary": "Get returns an application by name",
"operationId": "GetMixin8",
"summary": "GetApplication returns an application by name",
"operationId": "GetApplication",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -342,8 +342,8 @@
"tags": [
"ApplicationService"
],
"summary": "Delete deletes an application",
"operationId": "DeleteMixin8",
"summary": "DeleteApplication deletes an application",
"operationId": "DeleteApplication",
"parameters": [
{
"type": "string",
Expand All @@ -366,7 +366,7 @@
"ApplicationService"
],
"summary": "Patch patch an application",
"operationId": "Patch",
"operationId": "PatchApplication",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -780,8 +780,8 @@
"tags": [
"ApplicationService"
],
"summary": "Rollback syncs an application to its target state",
"operationId": "Rollback",
"summary": "RollbackApplication syncs an application to its target state",
"operationId": "RollbackApplication",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -846,8 +846,8 @@
"tags": [
"ApplicationService"
],
"summary": "Sync syncs an application to its target state",
"operationId": "Sync",
"summary": "SyncApplication syncs an application to its target state",
"operationId": "SyncApplication",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -981,8 +981,8 @@
"tags": [
"ClusterService"
],
"summary": "List returns list of clusters",
"operationId": "List",
"summary": "ListClusters returns list of clusters",
"operationId": "ListClusters",
"parameters": [
{
"type": "string",
Expand All @@ -1003,8 +1003,8 @@
"tags": [
"ClusterService"
],
"summary": "Create creates a cluster",
"operationId": "Create",
"summary": "CreateCluster creates a cluster",
"operationId": "CreateCluster",
"parameters": [
{
"name": "body",
Expand All @@ -1030,8 +1030,8 @@
"tags": [
"ClusterService"
],
"summary": "Update updates a cluster",
"operationId": "Update",
"summary": "UpdateCluster updates a cluster",
"operationId": "UpdateCluster",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -1063,8 +1063,8 @@
"tags": [
"ClusterService"
],
"summary": "Get returns a cluster by server address",
"operationId": "GetMixin2",
"summary": "GetCluster returns a cluster by server address",
"operationId": "GetCluster",
"parameters": [
{
"type": "string",
Expand All @@ -1086,8 +1086,8 @@
"tags": [
"ClusterService"
],
"summary": "Delete deletes a cluster",
"operationId": "Delete",
"summary": "DeleteCluster deletes a cluster",
"operationId": "DeleteCluster",
"parameters": [
{
"type": "string",
Expand All @@ -1111,7 +1111,7 @@
"tags": [
"ClusterService"
],
"summary": "RotateAuth returns a cluster by server address",
"summary": "RotateAuth rotates the bearer token used for a cluster",
"operationId": "RotateAuth",
"parameters": [
{
Expand All @@ -1136,8 +1136,8 @@
"tags": [
"ProjectService"
],
"summary": "List returns list of projects",
"operationId": "ListMixin6",
"summary": "ListProjects returns list of projects",
"operationId": "ListProjects",
"parameters": [
{
"type": "string",
Expand All @@ -1158,8 +1158,8 @@
"tags": [
"ProjectService"
],
"summary": "Create a new project.",
"operationId": "CreateMixin6",
"summary": "CreateProject a new project.",
"operationId": "CreateProject",
"parameters": [
{
"name": "body",
Expand All @@ -1185,8 +1185,8 @@
"tags": [
"ProjectService"
],
"summary": "Get returns a project by name",
"operationId": "GetMixin6",
"summary": "GetProject returns a project by name",
"operationId": "GetProject",
"parameters": [
{
"type": "string",
Expand All @@ -1208,8 +1208,8 @@
"tags": [
"ProjectService"
],
"summary": "Delete deletes a project",
"operationId": "DeleteMixin6",
"summary": "DeleteProject deletes a project",
"operationId": "DeleteProject",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -1283,8 +1283,8 @@
"tags": [
"ProjectService"
],
"summary": "Update updates a project",
"operationId": "UpdateMixin6",
"summary": "UpdateProject updates a project",
"operationId": "UpdateProject",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -1743,8 +1743,8 @@
"tags": [
"SessionService"
],
"summary": "Create a new JWT for authentication and set a cookie if using HTTP.",
"operationId": "CreateMixin10",
"summary": "CreateSession a new JWT for authentication and set a cookie if using HTTP.",
"operationId": "CreateSession",
"parameters": [
{
"name": "body",
Expand All @@ -1768,8 +1768,8 @@
"tags": [
"SessionService"
],
"summary": "Delete an existing JWT cookie if using HTTP.",
"operationId": "DeleteMixin10",
"summary": "DeleteSession an existing JWT cookie if using HTTP.",
"operationId": "DeleteSession",
"responses": {
"200": {
"description": "(empty)",
Expand Down Expand Up @@ -1819,8 +1819,8 @@
"tags": [
"ApplicationService"
],
"summary": "Watch returns stream of application change events.",
"operationId": "Watch",
"summary": "WatchApplications returns stream of application change events.",
"operationId": "WatchApplications",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -2064,7 +2064,8 @@
}
},
"clusterClusterResponse": {
"type": "object"
"type": "object",
"title": "ClusterResponse is a generic and empty response for methods in ClusterService API"
},
"clusterConnector": {
"type": "object",
Expand Down
32 changes: 16 additions & 16 deletions cmd/argocd/commands/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func NewApplicationCreateCommand(clientOpts *argocdclient.ClientOptions) *cobra.
Application: app,
Upsert: &upsert,
}
created, err := appIf.Create(context.Background(), &appCreateRequest)
created, err := appIf.CreateApplication(context.Background(), &appCreateRequest)
errors.CheckError(err)
fmt.Printf("application '%s' created\n", created.ObjectMeta.Name)
},
Expand Down Expand Up @@ -235,7 +235,7 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com
conn, appIf := acdClient.NewApplicationClientOrDie()
defer util.Close(conn)
appName := args[0]
app, err := appIf.Get(context.Background(), &applicationpkg.ApplicationQuery{Name: &appName, Refresh: getRefreshType(refresh, hardRefresh)})
app, err := appIf.GetApplication(context.Background(), &applicationpkg.ApplicationQuery{Name: &appName, Refresh: getRefreshType(refresh, hardRefresh)})
errors.CheckError(err)

pConn, projIf := argocdclient.NewClientOrDie(clientOpts).NewProjectClientOrDie()
Expand Down Expand Up @@ -450,7 +450,7 @@ func NewApplicationSetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com
argocdClient := argocdclient.NewClientOrDie(clientOpts)
conn, appIf := argocdClient.NewApplicationClientOrDie()
defer util.Close(conn)
app, err := appIf.Get(ctx, &applicationpkg.ApplicationQuery{Name: &appName})
app, err := appIf.GetApplication(ctx, &applicationpkg.ApplicationQuery{Name: &appName})
errors.CheckError(err)
visited := setAppSpecOptions(c.Flags(), &app.Spec, &appOpts)
if visited == 0 {
Expand Down Expand Up @@ -746,7 +746,7 @@ func NewApplicationUnsetCommand(clientOpts *argocdclient.ClientOptions) *cobra.C
appName := args[0]
conn, appIf := argocdclient.NewClientOrDie(clientOpts).NewApplicationClientOrDie()
defer util.Close(conn)
app, err := appIf.Get(context.Background(), &applicationpkg.ApplicationQuery{Name: &appName})
app, err := appIf.GetApplication(context.Background(), &applicationpkg.ApplicationQuery{Name: &appName})
errors.CheckError(err)

updated := false
Expand Down Expand Up @@ -910,7 +910,7 @@ func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
conn, appIf := clientset.NewApplicationClientOrDie()
defer util.Close(conn)
appName := args[0]
app, err := appIf.Get(context.Background(), &applicationpkg.ApplicationQuery{Name: &appName, Refresh: getRefreshType(refresh, hardRefresh)})
app, err := appIf.GetApplication(context.Background(), &applicationpkg.ApplicationQuery{Name: &appName, Refresh: getRefreshType(refresh, hardRefresh)})
errors.CheckError(err)
resources, err := appIf.ManagedResources(context.Background(), &applicationpkg.ResourcesQuery{ApplicationName: &appName})
errors.CheckError(err)
Expand Down Expand Up @@ -1064,7 +1064,7 @@ func NewApplicationDeleteCommand(clientOpts *argocdclient.ClientOptions) *cobra.
if c.Flag("cascade").Changed {
appDeleteReq.Cascade = &cascade
}
_, err := appIf.Delete(context.Background(), &appDeleteReq)
_, err := appIf.DeleteApplication(context.Background(), &appDeleteReq)
errors.CheckError(err)
}
},
Expand Down Expand Up @@ -1129,7 +1129,7 @@ func NewApplicationListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
Run: func(c *cobra.Command, args []string) {
conn, appIf := argocdclient.NewClientOrDie(clientOpts).NewApplicationClientOrDie()
defer util.Close(conn)
apps, err := appIf.List(context.Background(), &applicationpkg.ApplicationQuery{Selector: selector})
apps, err := appIf.ListApplications(context.Background(), &applicationpkg.ApplicationQuery{Selector: selector})
errors.CheckError(err)
appList := apps.Items
if len(projects) != 0 {
Expand Down Expand Up @@ -1254,7 +1254,7 @@ func NewApplicationWaitCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
closer, appIf := acdClient.NewApplicationClientOrDie()
defer util.Close(closer)
if selector != "" {
list, err := appIf.List(context.Background(), &applicationpkg.ApplicationQuery{Selector: selector})
list, err := appIf.ListApplications(context.Background(), &applicationpkg.ApplicationQuery{Selector: selector})
errors.CheckError(err)
for _, i := range list.Items {
appNames = append(appNames, i.Name)
Expand Down Expand Up @@ -1329,7 +1329,7 @@ func NewApplicationSyncCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co

appNames := args
if selector != "" {
list, err := appIf.List(context.Background(), &applicationpkg.ApplicationQuery{Selector: selector})
list, err := appIf.ListApplications(context.Background(), &applicationpkg.ApplicationQuery{Selector: selector})
errors.CheckError(err)
// unlike list, we'd want to fail if nothing was found
if len(list.Items) == 0 {
Expand Down Expand Up @@ -1378,7 +1378,7 @@ func NewApplicationSyncCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co

var localObjsStrings []string
if local != "" {
app, err := appIf.Get(context.Background(), &applicationpkg.ApplicationQuery{Name: &appName})
app, err := appIf.GetApplication(context.Background(), &applicationpkg.ApplicationQuery{Name: &appName})
errors.CheckError(err)
if app.Spec.SyncPolicy != nil && app.Spec.SyncPolicy.Automated != nil {
log.Fatal("Cannot use local sync when Automatic Sync Policy is enabled")
Expand Down Expand Up @@ -1417,7 +1417,7 @@ func NewApplicationSyncCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
log.Fatalf("Unknown sync strategy: '%s'", strategy)
}
ctx := context.Background()
_, err := appIf.Sync(ctx, &syncReq)
_, err := appIf.SyncApplication(ctx, &syncReq)
errors.CheckError(err)

if !async {
Expand Down Expand Up @@ -1788,7 +1788,7 @@ func NewApplicationHistoryCommand(clientOpts *argocdclient.ClientOptions) *cobra
conn, appIf := argocdclient.NewClientOrDie(clientOpts).NewApplicationClientOrDie()
defer util.Close(conn)
appName := args[0]
app, err := appIf.Get(context.Background(), &applicationpkg.ApplicationQuery{Name: &appName})
app, err := appIf.GetApplication(context.Background(), &applicationpkg.ApplicationQuery{Name: &appName})
errors.CheckError(err)
if output == "id" {
printApplicationHistoryIds(app.Status.History)
Expand Down Expand Up @@ -1822,7 +1822,7 @@ func NewApplicationRollbackCommand(clientOpts *argocdclient.ClientOptions) *cobr
conn, appIf := acdClient.NewApplicationClientOrDie()
defer util.Close(conn)
ctx := context.Background()
app, err := appIf.Get(ctx, &applicationpkg.ApplicationQuery{Name: &appName})
app, err := appIf.GetApplication(ctx, &applicationpkg.ApplicationQuery{Name: &appName})
errors.CheckError(err)
var depInfo *argoappv1.RevisionHistory
for _, di := range app.Status.History {
Expand All @@ -1835,7 +1835,7 @@ func NewApplicationRollbackCommand(clientOpts *argocdclient.ClientOptions) *cobr
log.Fatalf("Application '%s' does not have deployment id '%d' in history\n", app.ObjectMeta.Name, depID)
}

_, err = appIf.Rollback(ctx, &applicationpkg.ApplicationRollbackRequest{
_, err = appIf.RollbackApplication(ctx, &applicationpkg.ApplicationRollbackRequest{
Name: &appName,
ID: int64(depID),
Prune: prune,
Expand Down Expand Up @@ -1973,7 +1973,7 @@ func NewApplicationEditCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
appName := args[0]
conn, appIf := argocdclient.NewClientOrDie(clientOpts).NewApplicationClientOrDie()
defer util.Close(conn)
app, err := appIf.Get(context.Background(), &applicationpkg.ApplicationQuery{Name: &appName})
app, err := appIf.GetApplication(context.Background(), &applicationpkg.ApplicationQuery{Name: &appName})
errors.CheckError(err)
appData, err := json.Marshal(app.Spec)
errors.CheckError(err)
Expand Down Expand Up @@ -2023,7 +2023,7 @@ func NewApplicationPatchCommand(clientOpts *argocdclient.ClientOptions) *cobra.C
conn, appIf := argocdclient.NewClientOrDie(clientOpts).NewApplicationClientOrDie()
defer util.Close(conn)

patchedApp, err := appIf.Patch(context.Background(), &applicationpkg.ApplicationPatchRequest{
patchedApp, err := appIf.PatchApplication(context.Background(), &applicationpkg.ApplicationPatchRequest{
Name: &appName,
Patch: patch,
PatchType: patchType,
Expand Down
Loading