sumologic

package
v0.0.0-...-92f281c Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: MPL-2.0 Imports: 21 Imported by: 1

Documentation

Overview

----------------------------------------------------------------------------

***     AUTO GENERATED CODE    ***    AUTO GENERATED CODE     ***

----------------------------------------------------------------------------

This file is automatically generated by Sumo Logic and manual
changes will be clobbered when the file is regenerated. Do not submit
changes to this file.

----------------------------------------------------------------------------\

----------------------------------------------------------------------------

***     AUTO GENERATED CODE    ***    AUTO GENERATED CODE     ***

----------------------------------------------------------------------------

This file is automatically generated by Sumo Logic and manual
changes will be clobbered when the file is regenerated. Do not submit
changes to this file.

----------------------------------------------------------------------------\

----------------------------------------------------------------------------

***     AUTO GENERATED CODE    ***    AUTO GENERATED CODE     ***

----------------------------------------------------------------------------

This file is automatically generated by Sumo Logic and manual
changes will be clobbered when the file is regenerated. Do not submit
changes to this file.

----------------------------------------------------------------------------\

----------------------------------------------------------------------------

***     AUTO GENERATED CODE    ***    AUTO GENERATED CODE     ***

----------------------------------------------------------------------------

This file is automatically generated by Sumo Logic and manual
changes will be clobbered when the file is regenerated. Do not submit
changes to this file.

----------------------------------------------------------------------------\

----------------------------------------------------------------------------

***     AUTO GENERATED CODE    ***    AUTO GENERATED CODE     ***

----------------------------------------------------------------------------

This file is automatically generated by Sumo Logic and manual
changes will be clobbered when the file is regenerated. Do not submit
changes to this file.

----------------------------------------------------------------------------\

----------------------------------------------------------------------------

***     AUTO GENERATED CODE    ***    AUTO GENERATED CODE     ***

----------------------------------------------------------------------------

This file is automatically generated by Sumo Logic and manual
changes will be clobbered when the file is regenerated. Do not submit
changes to this file.

----------------------------------------------------------------------------\

Index

Constants

This section is empty.

Variables

View Source
var FieldsMap = map[string]map[string]string{
	"User": map[string]string{
		"firstName":           "Test",
		"lastName":            "User",
		"email":               "testterraform@demo.com",
		"isActive":            "true",
		"transferTo":          "",
		"updatedFirstName":    "TestUpdated",
		"updatedLastName":     "UserUpdated",
		"updatedEmail":        "testterraform@demo.com",
		"updatedIsActive":     "false",
		"preUpdateTransferTo": "nonExistentTestId",
	},

	"Role": map[string]string{
		"name":                   "TestTestTestTerraformRole",
		"description":            "test terraform role",
		"filterPredicate":        "_sourceCategory=org-service",
		"capabilities":           "manageContent",
		"updatedName":            "TestTestTestTerraformRoleUpdated",
		"updatedDescription":     "test terraform role updated",
		"updatedFilterPredicate": "_sourceCategory=bill",
		"updatedCapabilities":    "manageContent",
	},

	"FieldExtractionRule": map[string]string{
		"name":                   "TestTestTestTerraformFER",
		"scope":                  "_sourceHost=127.0.0.1",
		"parseExpression":        "csv _raw extract 1 as f1",
		"enabled":                "true",
		"updatedName":            "TestTestTestTerraformFERUpdated",
		"updatedScope":           "_sourceHost=127.0.0.1",
		"updatedParseExpression": "csv _raw extract 1 as f1",
		"updatedEnabled":         "true",
	},

	"IngestBudget": map[string]string{
		"name":                  "TestTestTerraformIngestBudget",
		"fieldValue":            "testTerraformAcceptanceTest",
		"capacityBytes":         "1000",
		"timezone":              "America/Los_Angeles",
		"resetTime":             "14:10",
		"description":           "string",
		"action":                "keepCollecting",
		"auditThreshold":        "85",
		"updatedName":           "TestTestTerraformIngestBudgetUpdated",
		"updatedFieldValue":     "testTerraformAcceptanceTest",
		"updatedCapacityBytes":  "1000",
		"updatedTimezone":       "America/Los_Angeles",
		"updatedResetTime":      "14:10",
		"updatedDescription":    "string updated",
		"updatedAction":         "keepCollecting",
		"updatedAuditThreshold": "90",
	},
}
View Source
var SumoMutexKV = mutexkv.NewMutexKV()

Functions

func Provider

func Provider() terraform.ResourceProvider

Types

type Client

type Client struct {
	AccessID    string
	AccessKey   string
	Environment string
	BaseURL     *url.URL
	// contains filtered or unexported fields
}

func NewClient

func NewClient(accessID, accessKey, environment, base_url string) (*Client, error)

func (*Client) AssignCollectorToIngestBudget

func (s *Client) AssignCollectorToIngestBudget(ingestBudgetId string, collectorId int) error

func (*Client) CollectorAssignedToIngestBudget

func (s *Client) CollectorAssignedToIngestBudget(ingestBudgetId string, collectorId int) (bool, error)

func (*Client) CreateCloudsyslogSource

func (s *Client) CreateCloudsyslogSource(cloudSyslogSource CloudSyslogSource, collectorID int) (int, error)

func (*Client) CreateCollector

func (s *Client) CreateCollector(collector Collector) (int, error)

func (*Client) CreateConnection

func (s *Client) CreateConnection(connection Connection) (string, error)

CreateConnection creates connection with given params

func (*Client) CreateContent

func (s *Client) CreateContent(content Content, timeout time.Duration) (string, error)

CREATE

func (*Client) CreateFieldExtractionRule

func (s *Client) CreateFieldExtractionRule(fieldExtractionRule FieldExtractionRule) (string, error)

func (*Client) CreateFolder

func (s *Client) CreateFolder(folder Folder) (string, error)

CREATE

func (*Client) CreateHTTPSource

func (s *Client) CreateHTTPSource(httpSource HTTPSource, collectorID int) (int, error)

func (*Client) CreateIngestBudget

func (s *Client) CreateIngestBudget(budget IngestBudget) (string, error)

func (*Client) CreatePartition

func (s *Client) CreatePartition(spartition Partition) (*Partition, error)

func (*Client) CreatePollingSource

func (s *Client) CreatePollingSource(source PollingSource, collectorID int) (int, error)

func (*Client) CreateRole

func (s *Client) CreateRole(role Role) (string, error)

func (*Client) CreateScheduledView

func (s *Client) CreateScheduledView(sview ScheduledView) (*ScheduledView, error)

func (*Client) CreateUser

func (s *Client) CreateUser(user User) (string, error)

func (*Client) DecommissionPartition

func (s *Client) DecommissionPartition(id string) error

func (*Client) Delete

func (s *Client) Delete(urlPath string) ([]byte, error)

func (*Client) DeleteCollector

func (s *Client) DeleteCollector(id int) error

func (*Client) DeleteConnection

func (s *Client) DeleteConnection(id string, connectionType string) error

DeleteConnection deletes connection linked to id

func (*Client) DeleteContent

func (s *Client) DeleteContent(id string, timeout time.Duration) error

DELETE

func (*Client) DeleteFieldExtractionRule

func (s *Client) DeleteFieldExtractionRule(id string) error

func (*Client) DeleteFolder

func (s *Client) DeleteFolder(id string, timeout time.Duration) error

DELETE

func (*Client) DeleteIngestBudget

func (s *Client) DeleteIngestBudget(id string) error

func (*Client) DeleteRole

func (s *Client) DeleteRole(id string) error

func (*Client) DeleteScheduledView

func (s *Client) DeleteScheduledView(id string) error

func (*Client) DeleteUser

func (s *Client) DeleteUser(id string, transferTo string) error

func (*Client) DestroySource

func (s *Client) DestroySource(sourceID int, collectorID int) error

func (*Client) FindIngestBudget

func (s *Client) FindIngestBudget(name string) (*IngestBudget, error)

func (*Client) Get

func (s *Client) Get(urlPath string) ([]byte, string, error)

func (*Client) GetCloudSyslogSource

func (s *Client) GetCloudSyslogSource(collectorID, sourceID int) (*CloudSyslogSource, error)

func (*Client) GetCollector

func (s *Client) GetCollector(id int) (*Collector, error)

func (*Client) GetCollectorName

func (s *Client) GetCollectorName(name string) (*Collector, error)

func (*Client) GetConnection

func (s *Client) GetConnection(id string) (*Connection, error)

GetConnection returns connection information for given id

func (*Client) GetContent

func (s *Client) GetContent(id string, timeout time.Duration) (*Content, error)

READ

func (*Client) GetFieldExtractionRule

func (s *Client) GetFieldExtractionRule(id string) (*FieldExtractionRule, error)

func (*Client) GetFolder

func (s *Client) GetFolder(id string) (*Folder, error)

READ

func (*Client) GetHTTPSource

func (s *Client) GetHTTPSource(collectorID, sourceID int) (*HTTPSource, error)

func (*Client) GetIngestBudget

func (s *Client) GetIngestBudget(id string) (*IngestBudget, error)

func (*Client) GetPartition

func (s *Client) GetPartition(id string) (*Partition, error)

func (*Client) GetPollingSource

func (s *Client) GetPollingSource(collectorID, sourceID int) (*PollingSource, error)

func (*Client) GetRole

func (s *Client) GetRole(id string) (*Role, error)

func (*Client) GetScheduledView

func (s *Client) GetScheduledView(id string) (*ScheduledView, error)

func (*Client) GetSourceName

func (s *Client) GetSourceName(collectorID int, sourceName string) (*Source, error)

func (*Client) GetUser

func (s *Client) GetUser(id string) (*User, error)

func (*Client) GetWithCookies

func (s *Client) GetWithCookies(urlPath string, cookies []*http.Cookie) ([]byte, string, error)

func (*Client) Post

func (s *Client) Post(urlPath string, payload interface{}) ([]byte, error)

func (*Client) PostRawPayload

func (s *Client) PostRawPayload(urlPath string, payload string) ([]byte, error)

func (*Client) PostWithCookies

func (s *Client) PostWithCookies(urlPath string, payload interface{}) ([]byte, []*http.Cookie, error)

func (*Client) Put

func (s *Client) Put(urlPath string, payload interface{}) ([]byte, error)

func (*Client) UnAssignCollectorToIngestBudget

func (s *Client) UnAssignCollectorToIngestBudget(ingestBudgetId string, collectorId int) error

func (*Client) UpdateCloudSyslogSource

func (s *Client) UpdateCloudSyslogSource(source CloudSyslogSource, collectorID int) error

func (*Client) UpdateCollector

func (s *Client) UpdateCollector(collector Collector) error

func (*Client) UpdateConnection

func (s *Client) UpdateConnection(connection Connection) error

UpdateConnection updates connection with given params

func (*Client) UpdateFieldExtractionRule

func (s *Client) UpdateFieldExtractionRule(fieldExtractionRule FieldExtractionRule) error

func (*Client) UpdateFolder

func (s *Client) UpdateFolder(folder Folder) error

func (*Client) UpdateHTTPSource

func (s *Client) UpdateHTTPSource(source HTTPSource, collectorID int) error

func (*Client) UpdateIngestBudget

func (s *Client) UpdateIngestBudget(budget IngestBudget) error

func (*Client) UpdatePartition

func (s *Client) UpdatePartition(spartition Partition) error

func (*Client) UpdatePollingSource

func (s *Client) UpdatePollingSource(source PollingSource, collectorID int) error

func (*Client) UpdateRole

func (s *Client) UpdateRole(role Role) error

func (*Client) UpdateScheduledView

func (s *Client) UpdateScheduledView(sview ScheduledView) error

func (*Client) UpdateUser

func (s *Client) UpdateUser(user User) error

type CloudSyslogSource

type CloudSyslogSource struct {
	Source
	Token string `json:"token,omitempty"`
}

type Collector

type Collector struct {
	ID               int                    `json:"id,omitempty"`
	CollectorType    string                 `json:"collectorType,omitempty"`
	Name             string                 `json:"name"`
	Description      string                 `json:"description,omitempty"`
	Category         string                 `json:"category,omitempty"`
	TimeZone         string                 `json:"timeZone,omitempty"`
	Fields           map[string]interface{} `json:"fields,omitempty"`
	Links            []CollectorLink        `json:"links,omitempty"`
	CollectorVersion string                 `json:"collectorVersion,omitempty"`
	LastSeenAlive    int                    `json:"lastSeenAlive,omitempty"`
	Alive            bool                   `json:"alive,omitempty"`
}
type CollectorLink struct {
	Rel  string `json:"rel,omitempty"`
	Href string `json:"href,omitempty"`
}

type CollectorList

type CollectorList struct {
	Collectors []Collector `json:"collectors"`
}

type CollectorRequest

type CollectorRequest struct {
	Collector Collector `json:"collector"`
}

type CollectorResponse

type CollectorResponse struct {
	Collector Collector `json:"collector"`
}

type Connection

type Connection struct {
	ID             string    `json:"id,omitempty"`
	Type           string    `json:"type"`
	Name           string    `json:"name"`
	Description    string    `json:"description,omitempty"`
	URL            string    `json:"url"`
	Headers        []Headers `json:"headers,omitempty"`
	CustomHeaders  []Headers `json:"customHeaders,omitempty"`
	DefaultPayload string    `json:"defaultPayload"`
	WebhookType    string    `json:"webhookType"`
}

Connection is used to describe a connection.

type Content

type Content struct {
	ID             string      `json:"id,omitempty"`
	Type           string      `json:"type"`
	Name           string      `json:"name"`
	Description    string      `json:"description"`
	Children       []Content   `json:"children,omitempty"`
	Search         interface{} `json:"search"`
	SearchSchedule interface{} `json:"searchSchedule"`
	Config         string      `json:"-"`
	ParentId       string      `json:"-"`
}

type DefaultDateFormat

type DefaultDateFormat struct {
	Format  string `json:"format"`
	Locator string `json:"locator"`
}

type Error

type Error struct {
	Code    string `json:"status"`
	Message string `json:"message"`
	Detail  string `json:"detail"`
}

type FieldExtractionRule

type FieldExtractionRule struct {
	ID string `json:"id,omitempty"`
	// Name of the field extraction rule. Use a name that makes it easy to identify the rule.
	Name string `json:"name"`
	// Scope of the field extraction rule. This could be a sourceCategory, sourceHost, or any other metadata that describes the data you want to extract from. Think of the Scope as the first portion of an ad hoc search, before the first pipe ( | ). You'll use the Scope to run a search against the rule.
	Scope string `json:"scope"`
	// Describes the fields to be parsed.
	ParseExpression string `json:"parseExpression"`
	// Is the field extraction rule enabled.
	Enabled bool `json:"enabled"`
}

models

type Filter

type Filter struct {
	Name       string `json:"name"`
	FilterType string `json:"filterType"`
	Regexp     string `json:"regexp"`
	Mask       string `json:"mask"`
}

type Folder

type Folder struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	ParentId    string `json:"parentId"`
	CreatedBy   string `json:"createdBy,omitempty"`
}

type FolderUpdate

type FolderUpdate struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type HTTPSource

type HTTPSource struct {
	Source
	MessagePerRequest bool   `json:"messagePerRequest"`
	URL               string `json:"url,omitempty"`
}

type Headers

type Headers struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Headers is used to describe headers for http requests.

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type IngestBudget

type IngestBudget struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name"`
	FieldValue  string `json:"fieldValue"`
	Capacity    int    `json:"capacityBytes"`
	Timezone    string `json:"timezone"`
	ResetTime   string `json:"resetTime"`
	Description string `json:"description,omitempty"`
	Action      string `json:"action"`
}

type JobId

type JobId struct {
	ID string `json:"id,omitempty"`
}

type Partition

type Partition struct {
	ID                string `json:"id,omitempty"`
	Name              string `json:"name"`
	RoutingExpression string `json:"routingExpression"`
	AnalyticsTier     string `json:"analyticsTier"`
	RetentionPeriod   int    `json:"retentionPeriod"`
	IsCompliant       bool   `json:"isCompliant"`
	DataForwardingId  string `json:"dataForwardingId"`
}

type PollingAuthentication

type PollingAuthentication struct {
	Type    string `json:"type"`
	AwsID   string `json:"awsId"`
	AwsKey  string `json:"awsKey"`
	RoleARN string `json:"roleARN"`
}

type PollingPath

type PollingPath struct {
	Type              string      `json:"type"`
	BucketName        string      `json:"bucketName,omitempty"`
	PathExpression    string      `json:"pathExpression,omitempty"`
	LimitToRegions    []string    `json:"limitToRegions,omitempty"`
	LimitToNamespaces []string    `json:"limitToNamespaces,omitempty"`
	TagFilters        []TagFilter `json:"tagFilters,omitempty"`
}

type PollingResource

type PollingResource struct {
	ServiceType    string                `json:"serviceType"`
	Authentication PollingAuthentication `json:"authentication"`
	Path           PollingPath           `json:"path"`
}

type PollingSource

type PollingSource struct {
	Source
	ContentType   string               `json:"contentType"`
	ScanInterval  int                  `json:"scanInterval"`
	Paused        bool                 `json:"paused"`
	URL           string               `json:"url"`
	ThirdPartyRef PollingThirdPartyRef `json:"thirdPartyRef,omitempty"`
}

type PollingThirdPartyRef

type PollingThirdPartyRef struct {
	Resources []PollingResource `json:"resources"`
}

type Role

type Role struct {
	ID string `json:"id,omitempty"`
	// Name of the role.
	Name string `json:"name"`
	// Description of the role.
	Description string `json:"description"`
	// A search filter to restrict access to specific logs. The filter is silently added to the beginning of each query a user runs. For example, using '!_sourceCategory=billing' as a filter predicate will prevent users assigned to the role from viewing logs from the source category named 'billing'.
	FilterPredicate string `json:"filterPredicate"`
	// List of user identifiers to assign the role to.
	Users []string `json:"users"`
	// List of [capabilities](https://help.sumologic.com/Manage/Users-and-Roles/Manage-Roles/Role-Capabilities) associated with this role. Valid values are   ### Connections   - manageConnections   ### Collectors   - manageCollectors   - viewCollectors   ### Dashboards   - shareDashboardWhitelist   - shareDashboardWorld   ### Data Management   - manageContent   - manageDataVolumeFeed   - manageFieldExtractionRules   - manageIndexes   - manageS3DataForwarding   ### Metrics   - manageMonitors   - metricsExtraction   ### Security   - ipWhitelisting   - manageAccessKeys   - manageAuditDataFeed   - managePasswordPolicy   - manageSaml   - manageSupportAccountAccess   - manageUsersAndRoles   - shareDashboardOutsideOrg
	Capabilities []string `json:"capabilities"`
}

models

type ScheduledView

type ScheduledView struct {
	ID               string    `json:"id,omitempty"`
	Query            string    `json:"query"`
	IndexName        string    `json:"indexName"`
	StartTime        time.Time `json:"startTime"`
	RetentionPeriod  int       `json:"retentionPeriod"`
	DataForwardingId string    `json:"dataForwardingId"`
}

type Source

type Source struct {
	ID                         int                    `json:"id,omitempty"`
	Type                       string                 `json:"sourceType"`
	Name                       string                 `json:"name"`
	Description                string                 `json:"description,omitempty"`
	Category                   string                 `json:"category,omitempty"`
	HostName                   string                 `json:"hostName,omitempty"`
	TimeZone                   string                 `json:"timeZone,omitempty"`
	AutomaticDateParsing       bool                   `json:"automaticDateParsing"`
	MultilineProcessingEnabled bool                   `json:"multilineProcessingEnabled"`
	UseAutolineMatching        bool                   `json:"useAutolineMatching"`
	ManualPrefixRegexp         string                 `json:"manualPrefixRegexp,omitempty"`
	ForceTimeZone              bool                   `json:"forceTimeZone"`
	DefaultDateFormats         []DefaultDateFormat    `json:"defaultDateFormats,omitempty"`
	Filters                    []Filter               `json:"filters,omitempty"`
	CutoffTimestamp            int                    `json:"cutoffTimestamp,omitempty"`
	CutoffRelativeTime         string                 `json:"cutoffRelativeTime,omitempty"`
	Fields                     map[string]interface{} `json:"fields,omitempty"`
	Url                        string                 `json:"url,omitempty"`
	ContentType                string                 `json:"contentType,omitempty"`
}

type SourceList

type SourceList struct {
	Sources []Source `json:"sources"`
}

type Status

type Status struct {
	Status        string  `json:"status"`
	StatusMessage string  `json:"statusMessage"`
	Errors        []Error `json:"errors"`
}

type TagFilter

type TagFilter struct {
	Type      string   `json:"type"`
	Namespace string   `json:"namespace"`
	Tags      []string `json:"tags"`
}

type User

type User struct {
	ID string `json:"id,omitempty"`
	// First name of the user.
	FirstName string `json:"firstName"`
	// Last name of the user.
	LastName string `json:"lastName"`
	// Email address of the user.
	Email string `json:"email"`
	// List of roleIds associated with the user.
	RoleIds []string `json:"roleIds"`
	// True if the user is active.
	IsActive bool `json:"isActive"`
}

models

Jump to

Keyboard shortcuts

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