Skip to content

Commit

Permalink
chore(api,cli): remove old /mon/errors admin route (#6064)
Browse files Browse the repository at this point in the history
Signed-off-by: francois  samin <[email protected]>
  • Loading branch information
fsamin authored Jan 24, 2022
1 parent be89b36 commit 2b56b04
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 177 deletions.
1 change: 0 additions & 1 deletion cli/cdsctl/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ func adminCommands() []*cobra.Command {
adminMigrations(),
adminPlugins(),
adminBroadcasts(),
adminErrors(),
adminCurl(),
adminFeatures(),
adminWorkflows(),
Expand Down
45 changes: 0 additions & 45 deletions cli/cdsctl/admin_errors.go

This file was deleted.

2 changes: 0 additions & 2 deletions cli/cdsctl/worker_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ func newWorkerModelDisplay(wm sdk.Model) workerModelDisplay {
name := wm.Name
if wm.Group != nil {
name = fmt.Sprintf("%s/%s", wm.Group.Name, wm.Name)
} else {
name = wm.Name
}

var image, flavor string
Expand Down
7 changes: 1 addition & 6 deletions engine/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,7 @@ type Configuration struct {
} `toml:"artifact" comment:"Either filesystem local storage or Openstack Swift Storage are supported" json:"artifact"`
DefaultOS string `toml:"defaultOS" default:"linux" comment:"if no model and os/arch is specified in your job's requirements then spawn worker on this operating system (example: darwin, freebsd, linux, windows)" json:"defaultOS"`
DefaultArch string `toml:"defaultArch" default:"amd64" comment:"if no model and no os/arch is specified in your job's requirements then spawn worker on this architecture (example: amd64, arm, 386)" json:"defaultArch"`
Graylog struct {
AccessToken string `toml:"accessToken" json:"-"`
Stream string `toml:"stream" json:"-"`
URL string `toml:"url" comment:"Example: http://localhost:9000" json:"url"`
} `toml:"graylog" json:"graylog" comment:"###########################\n Graylog Search. \n When CDS API generates errors, you can fetch them with cdsctl. \n Examples: \n $ cdsctl admin errors get <error-id> \n $ cdsctl admin errors get 55f6e977-d39b-11e8-8513-0242ac110007 \n##########################"`
Log struct {
Log struct {
StepMaxSize int64 `toml:"stepMaxSize" default:"15728640" comment:"Max step logs size in bytes (default: 15MB)" json:"stepMaxSize"`
ServiceMaxSize int64 `toml:"serviceMaxSize" default:"15728640" comment:"Max service logs size in bytes (default: 15MB)" json:"serviceMaxSize"`
} `toml:"log" json:"log" comment:"###########################\n Log settings.\n##########################"`
Expand Down
1 change: 0 additions & 1 deletion engine/api/api_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ func (api *API) InitRouter() {
r.Handle("/mon/metrics", ScopeNone(), r.GET(service.GetPrometheustMetricsHandler(api), service.OverrideAuth(service.NoAuthMiddleware)))
r.Handle("/mon/metrics/all", ScopeNone(), r.GET(service.GetMetricsHandler, service.OverrideAuth(service.NoAuthMiddleware)))
r.HandlePrefix("/mon/metrics/detail/", ScopeNone(), r.GET(service.GetMetricHandler("/mon/metrics/detail/"), service.OverrideAuth(service.NoAuthMiddleware)))
r.Handle("/mon/errors/{uuid}", ScopeNone(), r.GET(api.getErrorHandler, service.OverrideAuth(api.authAdminMiddleware)))

r.Handle("/help", ScopeNone(), r.GET(api.getHelpHandler, service.OverrideAuth(service.NoAuthMiddleware)))

Expand Down
76 changes: 0 additions & 76 deletions engine/api/error.go

This file was deleted.

15 changes: 0 additions & 15 deletions sdk/cdsclient/client_mon.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cdsclient

import (
"context"
"fmt"

"github.com/ovh/cds/sdk"
)
Expand Down Expand Up @@ -30,17 +29,3 @@ func (c *client) MonDBMigrate() ([]sdk.MonDBMigrate, error) {
}
return monDBMigrate, nil
}

func (c *client) MonErrorsGet(requestID string) ([]sdk.Error, error) {
res, _, _, err := c.Request(context.Background(), "GET", fmt.Sprintf("/mon/errors/%s", requestID), nil)
if err != nil {
return nil, err
}

var errs []sdk.Error
if err := sdk.JSONUnmarshal(res, &errs); err != nil {
return nil, err
}

return errs, nil
}
1 change: 0 additions & 1 deletion sdk/cdsclient/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ type MonitoringClient interface {
MonStatus() (*sdk.MonitoringStatus, error)
MonVersion() (*sdk.Version, error)
MonDBMigrate() ([]sdk.MonDBMigrate, error)
MonErrorsGet(requestID string) ([]sdk.Error, error)
}

// IntegrationClient exposes integration functions
Expand Down
30 changes: 0 additions & 30 deletions sdk/cdsclient/mock_cdsclient/interface_mock.go

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

0 comments on commit 2b56b04

Please sign in to comment.