diff options
author | 6543 <6543@obermui.de> | 2020-09-06 17:37:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-06 11:37:53 -0400 |
commit | 0c6a8027315e704011bacb7bfd8158fe36470cda (patch) | |
tree | 8d73f8fa429ee0e8b2ddb1e6609be8460f0dd01d /vendor/github.com/xanzy/go-gitlab/runners.go | |
parent | 0ed5e103fef5986fcbbb7c208cc015727f4a79dd (diff) | |
download | gitea-0c6a8027315e704011bacb7bfd8158fe36470cda.tar.gz gitea-0c6a8027315e704011bacb7bfd8158fe36470cda.zip |
[Vendor] Update xanzy/go-gitlab v0.31.0 => v0.37.0 (#12701)
* update github.com/xanzy/go-gitlab v0.31.0 => v0.37.0
* vendor
* adapt changes
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'vendor/github.com/xanzy/go-gitlab/runners.go')
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/runners.go | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/github.com/xanzy/go-gitlab/runners.go b/vendor/github.com/xanzy/go-gitlab/runners.go index 775c3e11f3..96c23467bc 100644 --- a/vendor/github.com/xanzy/go-gitlab/runners.go +++ b/vendor/github.com/xanzy/go-gitlab/runners.go @@ -336,6 +336,44 @@ func (s *RunnersService) DisableProjectRunner(pid interface{}, runner int, optio return s.client.Do(req, nil) } +// ListGroupsRunnersOptions represents the available ListGroupsRunners() options. +// +// GitLab API docs: +// https://docs.gitlab.com/ee/api/runners.html#list-groups-runners +type ListGroupsRunnersOptions struct { + ListOptions + Type *string `url:"type,omitempty" json:"type,omitempty"` + Status *string `url:"status,omitempty" json:"status,omitempty"` + TagList []string `url:"tag_list,comma,omitempty" json:"tag_list,omitempty"` +} + +// ListGroupsRunners lists all runners (specific and shared) available in the +// group as well it’s ancestor groups. Shared runners are listed if at least one +// shared runner is defined. +// +// GitLab API docs: +// https://docs.gitlab.com/ee/api/runners.html#list-groups-runners +func (s *RunnersService) ListGroupsRunners(gid interface{}, opt *ListGroupsRunnersOptions, options ...RequestOptionFunc) ([]*Runner, *Response, error) { + group, err := parseID(gid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("groups/%s/runners", pathEscape(group)) + + req, err := s.client.NewRequest("GET", u, opt, options) + if err != nil { + return nil, nil, err + } + + var rs []*Runner + resp, err := s.client.Do(req, &rs) + if err != nil { + return nil, resp, err + } + + return rs, resp, err +} + // RegisterNewRunnerOptions represents the available RegisterNewRunner() // options. // |