Hooks up the CLI to be able to pass query parameters through to the service. Part of pulumi/pulumi-service#431.
43 lines
1.5 KiB
Go
43 lines
1.5 KiB
Go
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
|
|
|
|
package operations
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// LogEntry is a row in the logs for a running compute service
|
|
type LogEntry struct {
|
|
ID string
|
|
Timestamp int64
|
|
Message string
|
|
}
|
|
|
|
// ResourceFilter specifies a specific resource or subset of resources. It can be provided in three formats:
|
|
// - Full URN: "<namespace>::<alloc>::<type>::<name>"
|
|
// - Type + Name: "<type>::<name>"
|
|
// - Name: "<name>"
|
|
type ResourceFilter string
|
|
|
|
// LogQuery represents the parameters to a log query operation. All fields are
|
|
// optional, leaving them off returns all logs.
|
|
//
|
|
// IDEA: We are currently using this type both within the engine and as an
|
|
// apitype. We should consider splitting this into separate types for the engine
|
|
// and on the wire.
|
|
type LogQuery struct {
|
|
// StartTime is an optional time indiciating that only logs from after this time should be produced.
|
|
StartTime *time.Time `url:"startTime,unix"`
|
|
// EndTime is an optional time indiciating that only logs from before this time should be produced.
|
|
EndTime *time.Time `url:"endTime,unix"`
|
|
// ResourceFilter is a string indicating that logs should be limited to a resource or resources
|
|
ResourceFilter *ResourceFilter `url:"resourceFilter"`
|
|
}
|
|
|
|
// Provider is the interface for making operational requests about the
|
|
// state of a Component (or Components)
|
|
type Provider interface {
|
|
// GetLogs returns logs matching a query
|
|
GetLogs(query LogQuery) (*[]LogEntry, error)
|
|
// TODO[pulumi/pulumi#609] Add support for metrics
|
|
}
|