Documentation
¶
Index ¶
- Variables
- func GetTable(name string, props map[string]string) (getTableResp, error)
- func ListTables(token string, maxResults *int32) (page.Page[tableWire], error)
- type Execution
- type Export
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- func (h *Handler) StartWorker(ctx context.Context) error
- type InMemoryBackend
- func (b *InMemoryBackend) CreateExport(w *exportWire, tagList []tags.KV) (string, error)
- func (b *InMemoryBackend) DeleteExport(exportArn string) (string, error)
- func (b *InMemoryBackend) GetExecution(exportArn, id string) (getExecResp, error)
- func (b *InMemoryBackend) GetExport(exportArn string) (exportWire, exportStatusWire, error)
- func (b *InMemoryBackend) ListExecutions(exportArn, token string, maxResults *int32) (page.Page[execRefWire], error)
- func (b *InMemoryBackend) ListExports(token string, maxResults *int32) (page.Page[exportRefWire], error)
- func (b *InMemoryBackend) ListTagsForResource(resourceArn, token string, maxResults *int32) (page.Page[tags.KV], error)
- func (b *InMemoryBackend) ProcessExecutions(ctx context.Context)
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) SetCostSource(c billingexport.CostSource)
- func (b *InMemoryBackend) SetObjectStore(s billingexport.ObjectStore)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) TagResource(resourceArn string, list []tags.KV) error
- func (b *InMemoryBackend) UntagResource(resourceArn string, keys []string) error
- func (b *InMemoryBackend) UpdateExport(exportArn string, w *exportWire) (string, error)
- type Provider
Constants ¶
This section is empty.
Variables ¶
var ( ErrAccessDenied = errors.New("access denied") ErrInternalServer = errors.New("internal server error") ErrResourceNotFound = errors.New("resource not found") ErrServiceQuotaExceeded = errors.New("service quota exceeded") ErrThrottling = errors.New("throttled") ErrValidation = errors.New("validation failed") )
Sentinels, one per exception in the pinned SDK's error set.
Functions ¶
Types ¶
type Execution ¶
type Execution struct {
CreatedAt time.Time `json:"createdAt"`
LastUpdatedAt time.Time `json:"lastUpdatedAt"`
CompletedAt time.Time `json:"completedAt"`
Export Export `json:"export"`
Key string `json:"key"`
ID string `json:"id"`
ExportARN string `json:"exportArn"`
StatusCode string `json:"statusCode"`
StatusReason string `json:"statusReason"`
}
Execution is one run of an export; Export is the definition it ran with.
type Export ¶
type Export struct {
CreatedAt time.Time `json:"createdAt"`
LastUpdatedAt time.Time `json:"lastUpdatedAt"`
LastRefreshedAt time.Time `json:"lastRefreshedAt"`
TableConfigs map[string]map[string]string `json:"tableConfigs"`
Tags map[string]string `json:"tags"`
ARN string `json:"arn"`
Name string `json:"name"`
Description string `json:"description"`
Query string `json:"query"`
S3Bucket string `json:"s3Bucket"`
S3Prefix string `json:"s3Prefix"`
S3Region string `json:"s3Region"`
S3BucketOwner string `json:"s3BucketOwner"`
OutputType string `json:"outputType"`
Format string `json:"format"`
Compression string `json:"compression"`
Overwrite string `json:"overwrite"`
Frequency string `json:"frequency"`
StatusCode string `json:"statusCode"`
StatusReason string `json:"statusReason"`
}
Export is a stored data export and its health.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
}
Handler serves the Data Exports awsjson1.1 API.
func (*Handler) ChaosOperations ¶
ChaosOperations lists the fault-injectable operations.
func (*Handler) ChaosRegions ¶
ChaosRegions lists the regions this handler serves; Data Exports is homed in us-east-1.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase service name for fault rules.
func (*Handler) ExtractOperation ¶
ExtractOperation returns the operation name from X-Amz-Target.
func (*Handler) ExtractResource ¶
ExtractResource returns the operation name; the API has no single resource key.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations lists every routed operation.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the echo handler.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher matches the AWSBillingAndCostManagementDataExports X-Amz-Target prefix.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the Data Exports state; one coarse lock guards the tables and wired sinks.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates an empty backend.
func (*InMemoryBackend) CreateExport ¶
func (b *InMemoryBackend) CreateExport(w *exportWire, tagList []tags.KV) (string, error)
CreateExport creates an export and queues its first execution.
func (*InMemoryBackend) DeleteExport ¶
func (b *InMemoryBackend) DeleteExport(exportArn string) (string, error)
DeleteExport removes an export and its executions.
func (*InMemoryBackend) GetExecution ¶
func (b *InMemoryBackend) GetExecution(exportArn, id string) (getExecResp, error)
GetExecution returns one execution and the definition it ran with.
func (*InMemoryBackend) GetExport ¶
func (b *InMemoryBackend) GetExport(exportArn string) (exportWire, exportStatusWire, error)
GetExport returns an export and its status.
func (*InMemoryBackend) ListExecutions ¶
func (b *InMemoryBackend) ListExecutions(exportArn, token string, maxResults *int32) (page.Page[execRefWire], error)
ListExecutions lists an export's executions, newest first.
func (*InMemoryBackend) ListExports ¶
func (b *InMemoryBackend) ListExports(token string, maxResults *int32) (page.Page[exportRefWire], error)
ListExports lists exports ordered by name.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource( resourceArn, token string, maxResults *int32, ) (page.Page[tags.KV], error)
ListTagsForResource returns an export's tags.
func (*InMemoryBackend) ProcessExecutions ¶
func (b *InMemoryBackend) ProcessExecutions(ctx context.Context)
ProcessExecutions advances every in-flight execution one lifecycle step; delivery writes the result to S3.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the home region.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads a snapshot; an incompatible version is discarded.
func (*InMemoryBackend) SetCostSource ¶
func (b *InMemoryBackend) SetCostSource(c billingexport.CostSource)
SetCostSource wires the cost data the cost tables are derived from.
func (*InMemoryBackend) SetObjectStore ¶
func (b *InMemoryBackend) SetObjectStore(s billingexport.ObjectStore)
SetObjectStore wires the S3 exports are delivered to.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(resourceArn string, list []tags.KV) error
TagResource adds or replaces tags on an export.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(resourceArn string, keys []string) error
UntagResource removes tags by key.
func (*InMemoryBackend) UpdateExport ¶
func (b *InMemoryBackend) UpdateExport(exportArn string, w *exportWire) (string, error)
UpdateExport replaces an export definition and queues a new execution.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for AWS Billing and Cost Management Data Exports.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init builds the backend and handler.