metricsscope

package
v1.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImportService

type ImportService struct {
	MetricsScopesService   *Service
	ResourceManagerService *crmbox.ResourceManagerService
}

func NewImportService

func NewImportService(ctx context.Context, metricsScopesService *Service, resourceManagerService *crmbox.ResourceManagerService) (*ImportService, error)

func (*ImportService) ImportMonitoredProjects

func (s *ImportService) ImportMonitoredProjects(ctx context.Context, scopingProject string, parentResourceID *crmbox.ResourceID, ops ...ImportServiceOptions) (importCount int, err error)

ImportMonitoredProjects is scopingProjectのMetricsScopeにparentResourceID配下のProjectを追加する

type ImportServiceOptions

type ImportServiceOptions func(option *importServiceOptions)

func WithSkipResources

func WithSkipResources(resources ...*crmbox.ResourceID) ImportServiceOptions

WithSkipResources is SkipするResourceを指定する folderを指定した場合はfolder配下すべてをSkipする

type MetricsScope

type MetricsScope struct {
	// Immutable. The resource name of the Monitoring Metrics Scope.
	// On input, the resource name can be specified with the
	// scoping project ID or number. On output, the resource name is
	// specified with the scoping project number.
	// Example:
	// `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}`
	Name string `json:"name"`

	// Output only. The time when this `Metrics Scope` was created.
	CreateTime time.Time `json:"createTime"`

	// Output only. The time when this `Metrics Scope` record was last updated.
	UpdateTime time.Time `json:"updateTime"`

	// Output only. The list of projects monitored by this `Metrics Scope`.
	MonitoredProjects []*MonitoredProject `json:"monitoredProjects"`
}

func NewMetricsScope

func NewMetricsScope(value *metricsscopepb.MetricsScope) *MetricsScope

func (*MetricsScope) ScopingProjectIDOrNumber

func (ms *MetricsScope) ScopingProjectIDOrNumber() (string, error)

ScopingProjectIDOrNumber is MetricsScope.NameからProjectIDOrNumberを抜き出す 基本、ProjectNumberが返ってくる

type MonitoredProject

type MonitoredProject struct {
	// Immutable. The resource name of the `MonitoredProject`. On input, the resource name
	// includes the scoping project ID and monitored project ID. On output, it
	// contains the equivalent project numbers.
	// Example:
	// `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}`
	Name string `json:"name"`

	CreateTime time.Time `json:"createTime"`
}

func NewMonitoredProject

func NewMonitoredProject(value *metricsscopepb.MonitoredProject) *MonitoredProject

func (*MonitoredProject) MonitoredProjectIDOrNumber

func (mp *MonitoredProject) MonitoredProjectIDOrNumber() (string, error)

MonitoredProjectIDOrNumber is MonitoredProject.NameからMonitoredProjectIDOrNumberを抜き出す 基本、ProjectNumberが返ってくる

func (*MonitoredProject) ScopingProjectIDOrNumber

func (mp *MonitoredProject) ScopingProjectIDOrNumber() (string, error)

ScopingProjectIDOrNumber is MonitoredProject.NameからScopingProjectIDOrNumberを抜き出す 基本、ProjectNumberが返ってくる

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is Monitoring Metrics Scope Service

func NewService

func NewService(ctx context.Context, metricsScopeClient *metricsscope.MetricsScopesClient) (*Service, error)

func (*Service) CreateMonitoredProject

func (s *Service) CreateMonitoredProject(ctx context.Context, scopingProject string, monitoredProject string) (ret *MonitoredProject, err error)

CreateMonitoredProject is scopingProjectにmonitoringProjectのmetricsを追加する scopingProject, monitoringProjectはPROJECT_ID or PROJECT_NUMBERを指定する

func (*Service) DeleteMonitoredProject

func (s *Service) DeleteMonitoredProject(ctx context.Context, scopingProject string, monitoredProject string) (err error)

DeleteMonitoredProject is 指定したMonitoredProjectをScoping Projectのmetrics scopeから削除する scopingProject, monitoringProjectはPROJECT_ID or PROJECT_NUMBERを指定する

func (*Service) DeleteMonitoredProjectByMonitoredProjectName

func (s *Service) DeleteMonitoredProjectByMonitoredProjectName(ctx context.Context, monitoredProjectName string) (err error)

DeleteMonitoredProjectByMonitoredProjectName is 指定したMonitoredProjectを削除する

Example:
  `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}`

func (*Service) GetMetricsScope

func (s *Service) GetMetricsScope(ctx context.Context, project string) (ret *MetricsScope, err error)

GetMetricsScope is 指定したScopingProjectのMetricsScopeを返す 指定するのはPROJECT_ID or PROJECT_NUMBER

func (*Service) ListMetricsScopesByMonitoredProject

func (s *Service) ListMetricsScopesByMonitoredProject(ctx context.Context, project string) (rets []*MetricsScope, err error)

ListMetricsScopesByMonitoredProject is 指定したProjectを追加しているMetricsScopeの一覧を返す 指定するのはPROJECT_ID or PROJECT_NUMBER

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL