workloads

package
v0.86.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Overview

Package workloads provides a programmatic API for interacting with New Relic One workloads. It can be used to create, read, update, and delete workloads.

Authentication

You will need a valid Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key:

https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys

Code generated by tutone: DO NOT EDIT

Package workloads provides a programmatic API for interacting with New Relic One workloads.

Code generated by tutone: DO NOT EDIT

Index

Constants

View Source
const WorkloadCreateMutation = `` /* 906-byte string literal not displayed */
View Source
const WorkloadDeleteMutation = `` /* 842-byte string literal not displayed */
View Source
const WorkloadDuplicateMutation = `` /* 964-byte string literal not displayed */
View Source
const WorkloadUpdateMutation = `` /* 898-byte string literal not displayed */

Variables

View Source
var WorkloadGroupRemainingEntitiesRuleByTypes = struct {
	// Group the remaining entities rule by entity type.
	ENTITY_TYPE WorkloadGroupRemainingEntitiesRuleBy
	// Do not apply any grouping to the remaining entities rule.
	NONE WorkloadGroupRemainingEntitiesRuleBy
}{

	ENTITY_TYPE: "ENTITY_TYPE",

	NONE: "NONE",
}
View Source
var WorkloadResultingGroupTypeTypes = struct {
	// The rule considers the entities within a specific group in the workload.
	REGULAR_GROUP WorkloadResultingGroupType
	// The rule considers all the entities within the workload that aren’t evaluated in any other rule.
	REMAINING_ENTITIES WorkloadResultingGroupType
}{

	REGULAR_GROUP: "REGULAR_GROUP",

	REMAINING_ENTITIES: "REMAINING_ENTITIES",
}
View Source
var WorkloadRollupStrategyTypes = struct {
	// The group status matches the less critical status of all belonging entities.
	BEST_STATUS_WINS WorkloadRollupStrategy
	// The group status matches the most critical status of all belonging entities.
	WORST_STATUS_WINS WorkloadRollupStrategy
}{

	BEST_STATUS_WINS: "BEST_STATUS_WINS",

	WORST_STATUS_WINS: "WORST_STATUS_WINS",
}
View Source
var WorkloadRuleThresholdTypeTypes = struct {
	// The worst status is rolled up only after a certain number of entities within the workload are not operational.
	FIXED WorkloadRuleThresholdType
	// The worst status is rolled up only after a certain percentage of entities within the workload are not operational.
	PERCENTAGE WorkloadRuleThresholdType
}{

	FIXED: "FIXED",

	PERCENTAGE: "PERCENTAGE",
}
View Source
var WorkloadStatusSourceTypes = struct {
	// Refers to the result of an automatic rule defined for a workload.
	ROLLUP_RULE WorkloadStatusSource
	// Refers to a static status defined for a workload.
	STATIC WorkloadStatusSource
	// Refers to an undetermined status source.
	UNKNOWN WorkloadStatusSource
	// Refers to the override policy that is applied to a set of partial results within a workload. Any static status always overrides any other status values calculated automatically. Otherwise, the worst status of the partial results is rolled up.
	WORKLOAD WorkloadStatusSource
}{

	ROLLUP_RULE: "ROLLUP_RULE",

	STATIC: "STATIC",

	UNKNOWN: "UNKNOWN",

	WORKLOAD: "WORKLOAD",
}
View Source
var WorkloadStatusValueInputTypes = struct {
	// The status of the workload is degraded.
	DEGRADED WorkloadStatusValueInput
	// The status of the workload is disrupted.
	DISRUPTED WorkloadStatusValueInput
	// The status of the workload is operational.
	OPERATIONAL WorkloadStatusValueInput
}{

	DEGRADED: "DEGRADED",

	DISRUPTED: "DISRUPTED",

	OPERATIONAL: "OPERATIONAL",
}
View Source
var WorkloadStatusValueTypes = struct {
	// The status of the workload is degraded.
	DEGRADED WorkloadStatusValue
	// The status of the workload is disrupted.
	DISRUPTED WorkloadStatusValue
	// The status of the workload is operational.
	OPERATIONAL WorkloadStatusValue
	// The status of the workload is unknown.
	UNKNOWN WorkloadStatusValue
}{

	DEGRADED: "DEGRADED",

	DISRUPTED: "DISRUPTED",

	OPERATIONAL: "OPERATIONAL",

	UNKNOWN: "UNKNOWN",
}

Functions

This section is empty.

Types

type CreateInput deprecated

type CreateInput struct {
	EntityGUIDs         []string                 `json:"entityGuids,omitempty"`
	EntitySearchQueries []EntitySearchQueryInput `json:"entitySearchQueries,omitempty"`
	Name                string                   `json:"name,omitempty"`
	ScopeAccountsInput  *ScopeAccountsInput      `json:"scopeAccounts,omitempty"`
}

CreateInput represents the input parameters used for creating or updating a workload.

Deprecated: use WorkloadCreateInput instead

type DuplicateInput deprecated

type DuplicateInput struct {
	Name string `json:"name,omitempty"`
}

DuplicateInput represents the input object used to identify the workload to be duplicated.

Deprecated: use WorkloadDuplicateInput instead

type EntityRef deprecated

type EntityRef struct {
	GUID string `json:"guid,omitempty"`
}

EntityRef represents an entity referenced by this workload.

Deprecated: use WorkloadEntityRef instead

type EntitySearchQuery deprecated

type EntitySearchQuery struct {
	CreatedAt serialization.EpochTime  `json:"createdAt,omitempty"`
	CreatedBy users.UserReference      `json:"createdBy,omitempty"`
	ID        int                      `json:"id,omitempty"`
	Query     string                   `json:"query,omitempty"`
	UpdatedAt *serialization.EpochTime `json:"updatedAt,omitempty"`
}

EntitySearchQuery represents an entity search used by this workload.

Deprecated: use WorkloadEntitySearchQuery instead

type EntitySearchQueryInput deprecated

type EntitySearchQueryInput struct {
	Query string `json:"query,omitempty"`
}

EntitySearchQueryInput represents an entity search query for creating or updating a workload.

Deprecated: use WorkloadEntitySearchQueryInput instead

type ScopeAccounts deprecated

type ScopeAccounts struct {
	AccountIDs []int `json:"accountIds,omitempty"`
}

ScopeAccounts represents the accounts used to scope this workload.

Deprecated: use WorkloadScopeAccounts instead

type ScopeAccountsInput deprecated

type ScopeAccountsInput struct {
	AccountIDs []int `json:"accountIds,omitempty"`
}

ScopeAccountsInput is the input object containing accounts that will be used to get entities from.

Deprecated: use WorkloadScopeAccountsInput instead

type UpdateCollectionEntitySearchQueryInput deprecated

type UpdateCollectionEntitySearchQueryInput struct {
	ID int `json:"id,omitempty"`
	EntitySearchQueryInput
}

UpdateCollectionEntitySearchQueryInput represents an entity search query for creating or updating a workload.

Deprecated: use WorkloadUpdateCollectionEntitySearchQueryInput instead

type UpdateInput deprecated

type UpdateInput struct {
	EntityGUIDs         []string                 `json:"entityGuids,omitempty"`
	EntitySearchQueries []EntitySearchQueryInput `json:"entitySearchQueries,omitempty"`
	Name                string                   `json:"name,omitempty"`
	ScopeAccountsInput  *ScopeAccountsInput      `json:"scopeAccounts,omitempty"`
}

UpdateInput represents the input object used to identify the workload to be updated and its new changes.

Deprecated: use WorkloadUpdateInput instead

type Workload deprecated

type Workload struct {
	Account             nerdgraph.AccountReference `json:"account,omitempty"`
	CreatedAt           serialization.EpochTime    `json:"createdAt,omitempty"`
	CreatedBy           users.UserReference        `json:"createdBy,omitempty"`
	Entities            []EntityRef                `json:"entities,omitempty"`
	EntitySearchQueries []EntitySearchQuery        `json:"entitySearchQueries,omitempty"`
	EntitySearchQuery   string                     `json:"entitySearchQuery,omitempty"`
	GUID                string                     `json:"guid,omitempty"`
	ID                  int                        `json:"id,omitempty"`
	Name                string                     `json:"name,omitempty"`
	Permalink           string                     `json:"permalink,omitempty"`
	ScopeAccounts       ScopeAccounts              `json:"scopeAccounts,omitempty"`
	UpdatedAt           *serialization.EpochTime   `json:"updatedAt,omitempty"`
}

Workload represents a New Relic One workload.

Deprecated: use WorkloadCollection instead

type WorkloadAutomaticStatus added in v0.60.1

type WorkloadAutomaticStatus struct {
	// Whether the automatic status configuration is enabled or not.
	Enabled bool `json:"enabled"`
	// An additional meta-rule that can consider all entities that haven't been evaluated by any other rule.
	RemainingEntitiesRule WorkloadRemainingEntitiesRule `json:"remainingEntitiesRule,omitempty"`
	// A list of rules.
	Rules []WorkloadRegularRule `json:"rules"`
}

WorkloadAutomaticStatus - The automatic status configuration.

type WorkloadAutomaticStatusInput added in v0.60.1

type WorkloadAutomaticStatusInput struct {
	// Whether the automatic status configuration is enabled or not.
	Enabled bool `json:"enabled"`
	// An additional meta-rule that can consider all entities that haven't been evaluated by any other rule.
	RemainingEntitiesRule WorkloadRemainingEntitiesRuleInput `json:"remainingEntitiesRule,omitempty"`
	// A list of rules.
	Rules []WorkloadRegularRuleInput `json:"rules,omitempty"`
}

WorkloadAutomaticStatusInput - An input object used to represent an automatic status configuration. If not provided, a status configuration will be created by default.

type WorkloadCollection added in v0.60.1

type WorkloadCollection struct {
	// The account the workload belongs to.
	Account accounts.AccountReference `json:"account"`
	// The moment when the object was created, represented in milliseconds since the Unix epoch.
	CreatedAt *nrtime.EpochMilliseconds `json:"createdAt"`
	// The user who created the workload.
	CreatedBy users.UserReference `json:"createdBy"`
	// Relevant information about the workload.
	Description string `json:"description,omitempty"`
	// A list of entity GUIDs. These entities will belong to the collection as long as their accounts are included in the scope accounts of the collection.
	Entities []WorkloadEntityRef `json:"entities"`
	// A list of entity search queries. The resulting entities will be limited to the scope accounts of the collection.
	EntitySearchQueries []WorkloadEntitySearchQuery `json:"entitySearchQueries"`
	// The entity search query that returns the full collection of entities.
	EntitySearchQuery string `json:"entitySearchQuery,omitempty"`
	// The unique entity identifier of the workload in New Relic.
	GUID common.EntityGUID `json:"guid"`
	// The unique identifier of the workload.
	ID int `json:"id"`
	// The workload's name.
	Name string `json:"name"`
	// The URL of the workload.
	Permalink string `json:"permalink"`
	// Accounts that will be used to get entities from.
	ScopeAccounts WorkloadScopeAccounts `json:"scopeAccounts"`
	// Status of the workload.
	Status WorkloadWorkloadStatus `json:"status"`
	// The configuration that defines how the status of the workload is calculated.
	StatusConfig WorkloadStatusConfig `json:"statusConfig,omitempty"`
	// The moment when the object was last updated, represented in milliseconds since the Unix epoch.
	UpdatedAt *nrtime.EpochMilliseconds `json:"updatedAt,omitempty"`
	// The user who last updated the workload.
	UpdatedBy users.UserReference `json:"updatedBy,omitempty"`
}

WorkloadCollection - A user defined group of entities.

type WorkloadCreateInput added in v0.60.1

type WorkloadCreateInput struct {
	// Relevant information about the workload.
	Description string `json:"description,omitempty"`
	// A list of entity GUIDs composing the workload.
	EntityGUIDs []common.EntityGUID `json:"entityGuids"`
	// A list of entity search queries used to retrieve the entities that compose the workload.
	EntitySearchQueries []WorkloadEntitySearchQueryInput `json:"entitySearchQueries,omitempty"`
	// The name of the workload.
	Name string `json:"name"`
	// Accounts that will be used to get entities from.
	ScopeAccounts *WorkloadScopeAccountsInput `json:"scopeAccounts,omitempty"`
	// The configuration that defines how the status of the workload is calculated.
	StatusConfig *WorkloadStatusConfigInput `json:"statusConfig,omitempty"`
}

WorkloadCreateInput - The input object used to represent the workload to be created.

type WorkloadCreateQueryResponse added in v0.60.1

type WorkloadCreateQueryResponse struct {
	WorkloadCollection WorkloadCollection `json:"WorkloadCreate"`
}

type WorkloadDeleteQueryResponse added in v0.60.1

type WorkloadDeleteQueryResponse struct {
	WorkloadCollection WorkloadCollection `json:"WorkloadDelete"`
}

type WorkloadDuplicateInput added in v0.60.1

type WorkloadDuplicateInput struct {
	// The name of the workload duplicate. If the name isn't specified, the name + ' copy' of the source workload is used to compose the new name.
	Name string `json:"name,omitempty"`
}

WorkloadDuplicateInput - The input object used to represent the workload duplicate.

type WorkloadDuplicateQueryResponse added in v0.60.1

type WorkloadDuplicateQueryResponse struct {
	WorkloadCollection WorkloadCollection `json:"WorkloadDuplicate"`
}

type WorkloadEntityRef added in v0.60.1

type WorkloadEntityRef struct {
	// The unique entity identifier in New Relic.
	GUID common.EntityGUID `json:"guid,omitempty"`
}

WorkloadEntityRef - A reference to a New Relic entity.

type WorkloadEntitySearchQuery added in v0.60.1

type WorkloadEntitySearchQuery struct {
	// The moment when the object was created, represented in milliseconds since the Unix epoch.
	CreatedAt *nrtime.EpochMilliseconds `json:"createdAt"`
	// The user who created the entity search query.
	CreatedBy users.UserReference `json:"createdBy"`
	// The unique identifier of the entity search query.
	ID int `json:"id"`
	// The entity search query that is used to perform the search of a group of entities.
	Query string `json:"query"`
	// The moment when the object was last updated, represented in milliseconds since the Unix epoch.
	UpdatedAt *nrtime.EpochMilliseconds `json:"updatedAt,omitempty"`
}

WorkloadEntitySearchQuery - An entity search query used to dynamically retrieve a group of entities.

type WorkloadEntitySearchQueryInput added in v0.60.1

type WorkloadEntitySearchQueryInput struct {
	// The entity search query that is used to perform the search of a group of entities.
	Query string `json:"query"`
}

WorkloadEntitySearchQueryInput - The input object used to represent the entity search query to be created.

type WorkloadGroupRemainingEntitiesRuleBy added in v0.60.1

type WorkloadGroupRemainingEntitiesRuleBy string

WorkloadGroupRemainingEntitiesRuleBy - Indicates by which field the remaining entities rule should be grouped.

type WorkloadRegularRule added in v0.60.1

type WorkloadRegularRule struct {
	// A list of entity GUIDs. These entities will belong to the collection as long as their accounts are included in the scope accounts of the collection.
	Entities []WorkloadEntityRef `json:"entities"`
	// A list of entity search queries. These queries are constrained to the workload contents.
	EntitySearchQueries []WorkloadEntitySearchQuery `json:"entitySearchQueries"`
	// The unique identifier of the rule.
	ID int `json:"id,omitempty"`
	// The rollup strategy.
	Rollup WorkloadRollup `json:"rollup"`
}

WorkloadRegularRule - The definition of a rule, which consists of a group of entities and a rollup strategy.

type WorkloadRegularRuleInput added in v0.60.1

type WorkloadRegularRuleInput struct {
	// A list of entity GUIDs composing the rule.
	EntityGUIDs []common.EntityGUID `json:"entityGuids"`
	// A list of entity search queries used to retrieve the entities that compose the rule.
	EntitySearchQueries []WorkloadEntitySearchQueryInput `json:"entitySearchQueries,omitempty"`
	// The input object used to represent a rollup strategy.
	Rollup WorkloadRollupInput `json:"rollup,omitempty"`
}

WorkloadRegularRuleInput - The input object used to represent a rule.

type WorkloadRemainingEntitiesRule added in v0.60.1

type WorkloadRemainingEntitiesRule struct {
	// The rollup strategy.
	Rollup WorkloadRemainingEntitiesRuleRollup `json:"rollup"`
}

WorkloadRemainingEntitiesRule - The definition of a remaining entities rule.

type WorkloadRemainingEntitiesRuleInput added in v0.60.1

type WorkloadRemainingEntitiesRuleInput struct {
	// The input object used to represent a rollup strategy.
	Rollup WorkloadRemainingEntitiesRuleRollupInput `json:"rollup,omitempty"`
}

WorkloadRemainingEntitiesRuleInput - The input object used to represent a remaining entities rule.

type WorkloadRemainingEntitiesRuleRollup added in v0.60.1

type WorkloadRemainingEntitiesRuleRollup struct {
	// The grouping to be applied to the remaining entities.
	GroupBy WorkloadGroupRemainingEntitiesRuleBy `json:"groupBy"`
	// The rollup strategy that is applied to a group of entities.
	Strategy WorkloadRollupStrategy `json:"strategy"`
	// Type of threshold defined for the rule. This is an optional field that only applies when strategy is WORST_STATUS_WINS. Use a threshold to roll up the worst status only after a certain amount of entities are not operational.
	ThresholdType WorkloadRuleThresholdType `json:"thresholdType,omitempty"`
	// Threshold value defined for the rule. This optional field is used in combination with thresholdType. If the threshold type is null, the threshold value will be ignored.
	ThresholdValue int `json:"thresholdValue,omitempty"`
}

WorkloadRemainingEntitiesRuleRollup - The rollup strategy.

type WorkloadRemainingEntitiesRuleRollupInput added in v0.60.1

type WorkloadRemainingEntitiesRuleRollupInput struct {
	// The grouping to be applied to the remaining entities.
	GroupBy WorkloadGroupRemainingEntitiesRuleBy `json:"groupBy"`
	// The rollup strategy that is applied to a group of entities.
	Strategy WorkloadRollupStrategy `json:"strategy"`
	// Type of threshold defined for the rule. This is an optional field that only applies when strategy is WORST_STATUS_WINS. Use a threshold to roll up the worst status only after a certain amount of entities are not operational.
	ThresholdType WorkloadRuleThresholdType `json:"thresholdType,omitempty"`
	// Threshold value defined for the rule. This optional field is used in combination with thresholdType. If the threshold type is null, the threshold value will be ignored.
	ThresholdValue int `json:"thresholdValue,omitempty"`
}

WorkloadRemainingEntitiesRuleRollupInput - The input object used to represent a rollup strategy.

type WorkloadResultingGroupType added in v0.60.1

type WorkloadResultingGroupType string

WorkloadResultingGroupType - Represents the type of the rule that the resulting group of entities belongs to.

type WorkloadRollup added in v0.60.1

type WorkloadRollup struct {
	// The rollup strategy that is applied to the group of entities.
	Strategy WorkloadRollupStrategy `json:"strategy"`
	// Type of threshold defined for the rule. This is an optional field that only applies when strategy is WORST_STATUS_WINS. Use a threshold to roll up the worst status only after a certain amount of entities are not operational.
	ThresholdType WorkloadRuleThresholdType `json:"thresholdType,omitempty"`
	// Threshold value defined for the rule. This optional field is used in combination with thresholdType. If the threshold type is null, the threshold value will be ignored.
	ThresholdValue int `json:"thresholdValue,omitempty"`
}

WorkloadRollup - The rollup strategy.

type WorkloadRollupInput added in v0.60.1

type WorkloadRollupInput struct {
	// The rollup strategy that is applied to a group of entities.
	Strategy WorkloadRollupStrategy `json:"strategy"`
	// Type of threshold defined for the rule. This is an optional field that only applies when strategy is WORST_STATUS_WINS. Use a threshold to roll up the worst status only after a certain amount of entities are not operational.
	ThresholdType WorkloadRuleThresholdType `json:"thresholdType,omitempty"`
	// Threshold value defined for the rule. This optional field is used in combination with thresholdType. If the threshold type is null, the threshold value will be ignored.
	ThresholdValue int `json:"thresholdValue,omitempty"`
}

WorkloadRollupInput - The input object used to represent a rollup strategy.

type WorkloadRollupRuleDetails added in v0.60.1

type WorkloadRollupRuleDetails struct {
	// A list of entity search queries defined in the rule.
	EntitySearchQueries []string `json:"entitySearchQueries"`
	// Indicates if the rule has individual entities.
	HasIndividualEntities bool `json:"hasIndividualEntities"`
	// The amount of not operational entities after evaluating the rule.
	NotOperationalEntities int `json:"notOperationalEntities"`
	// The amount of operational entities after evaluating the rule.
	OperationalEntities int `json:"operationalEntities"`
	// The resulting type of the rollup rule.
	ResultingGroupType WorkloadResultingGroupType `json:"resultingGroupType"`
	// Type of threshold defined for the rule.
	ThresholdType WorkloadRuleThresholdType `json:"thresholdType,omitempty"`
	// The amount of entities the status of which is unknown.
	UnknownStatusEntities int `json:"unknownStatusEntities"`
}

WorkloadRollupRuleDetails - Represents the details of a rollup rule.

type WorkloadRollupRuleStatusResult added in v0.60.1

type WorkloadRollupRuleStatusResult struct {
	// Represents the details of a rollup rule.
	RollupRuleDetails WorkloadRollupRuleDetails `json:"rollupRuleDetails,omitempty"`
	// Indicates where the status value derives from.
	Source WorkloadStatusSource `json:"source"`
	// The status of a rollup rule.
	Value WorkloadStatusValue `json:"value"`
}

WorkloadRollupRuleStatusResult - A rollup rule that was involved in the calculation of the workload status.

func (*WorkloadRollupRuleStatusResult) ImplementsWorkloadStatusResult added in v0.60.1

func (x *WorkloadRollupRuleStatusResult) ImplementsWorkloadStatusResult()

type WorkloadRollupStrategy added in v0.60.1

type WorkloadRollupStrategy string

WorkloadRollupStrategy - Represents the rollup strategy that is applied to a group of entities.

type WorkloadRuleThresholdType added in v0.60.1

type WorkloadRuleThresholdType string

WorkloadRuleThresholdType - Represents the type of the threshold defined for a rule.

type WorkloadScopeAccounts added in v0.60.1

type WorkloadScopeAccounts struct {
	// A list of accounts that will be used to get entities from.
	AccountIDs []int `json:"accountIds"`
}

WorkloadScopeAccounts - Accounts that will be used to get entities from.

type WorkloadScopeAccountsInput added in v0.60.1

type WorkloadScopeAccountsInput struct {
	// A list of accounts that will be used to get entities from.
	AccountIDs []int `json:"accountIds"`
}

WorkloadScopeAccountsInput - The input object containing accounts that will be used to get entities from.

type WorkloadStaticStatus added in v0.60.1

type WorkloadStaticStatus struct {
	// A description that provides additional details about the status of the workload.
	Description string `json:"description,omitempty"`
	// Whether the static status configuration is enabled or not. Note that only one static status can be enabled at a given time.
	Enabled bool `json:"enabled"`
	// The unique identifier of the static status.
	ID int `json:"id"`
	// The status of the workload.
	Status WorkloadStatusValue `json:"status"`
	// A short description of the status of the workload.
	Summary string `json:"summary,omitempty"`
}

WorkloadStaticStatus - The static status configuration.

type WorkloadStaticStatusInput added in v0.60.1

type WorkloadStaticStatusInput struct {
	// A description that provides additional details about the status of the workload.
	Description string `json:"description,omitempty"`
	// Whether the static status configuration is enabled or not.
	Enabled bool `json:"enabled"`
	// The status of the workload.
	Status WorkloadStatusValueInput `json:"status"`
	// A short description of the status of the workload.
	Summary string `json:"summary,omitempty"`
}

WorkloadStaticStatusInput - The input object used to represent the configuration of a static status.

type WorkloadStaticStatusResult added in v0.60.1

type WorkloadStaticStatusResult struct {
	// A description that provides additional details about the status of the workload.
	Description string `json:"description,omitempty"`
	// Indicates where the status value derives from.
	Source WorkloadStatusSource `json:"source"`
	// A short description of the status of the workload.
	Summary string `json:"summary,omitempty"`
	// The value of a static status.
	Value WorkloadStatusValue `json:"value"`
}

WorkloadStaticStatusResult - A static status that was involved in the calculation of the workload status.

func (*WorkloadStaticStatusResult) ImplementsWorkloadStatusResult added in v0.60.1

func (x *WorkloadStaticStatusResult) ImplementsWorkloadStatusResult()

type WorkloadStatusConfig added in v0.60.1

type WorkloadStatusConfig struct {
	// An automatic status configuration.
	Automatic WorkloadAutomaticStatus `json:"automatic,omitempty"`
	// A list of static status configurations.
	Static []WorkloadStaticStatus `json:"static"`
}

WorkloadStatusConfig - The configuration that defines how the status of the workload is calculated.

type WorkloadStatusConfigInput added in v0.60.1

type WorkloadStatusConfigInput struct {
	// An input object used to represent an automatic status configuration.
	Automatic WorkloadAutomaticStatusInput `json:"automatic,omitempty"`
	// A list of static status configurations. You can only configure one static status for a workload.
	Static []WorkloadStaticStatusInput `json:"static,omitempty"`
}

WorkloadStatusConfigInput - The input object used to provide the configuration that defines how the status of the workload is calculated.

type WorkloadStatusResult added in v0.60.1

type WorkloadStatusResult struct {
	// Indicates where the status value derives from.
	Source WorkloadStatusSource `json:"source"`
	// The value of a status.
	Value WorkloadStatusValue `json:"value"`
}

WorkloadStatusResult - The details of a status that was involved in the calculation of the workload status.

func (*WorkloadStatusResult) ImplementsWorkloadStatusResult added in v0.60.1

func (x *WorkloadStatusResult) ImplementsWorkloadStatusResult()

type WorkloadStatusResultInterface added in v0.60.1

type WorkloadStatusResultInterface interface {
	ImplementsWorkloadStatusResult()
}

WorkloadStatusResult - The details of a status that was involved in the calculation of the workload status.

func UnmarshalWorkloadStatusResultInterface added in v0.60.1

func UnmarshalWorkloadStatusResultInterface(b []byte) (*WorkloadStatusResultInterface, error)

UnmarshalWorkloadStatusResultInterface unmarshals the interface into the correct type based on __typename provided by GraphQL

type WorkloadStatusSource added in v0.60.1

type WorkloadStatusSource string

WorkloadStatusSource - Indicates where the status value derives from.

type WorkloadStatusValue added in v0.60.1

type WorkloadStatusValue string

WorkloadStatusValue - The status of the workload, which is derived from the static and the automatic statuses configured. Any static status always overrides any other status values calculated automatically.

type WorkloadStatusValueInput added in v0.60.1

type WorkloadStatusValueInput string

WorkloadStatusValueInput - The status value. Any static status always overrides any other status values calculated automatically.

type WorkloadUpdateAutomaticStatusInput added in v0.60.1

type WorkloadUpdateAutomaticStatusInput struct {
	// Whether the automatic status configuration is enabled or not.
	Enabled bool `json:"enabled"`
	// An additional meta-rule that can consider all entities that haven't been evaluated by any other rule.
	RemainingEntitiesRule WorkloadRemainingEntitiesRuleInput `json:"remainingEntitiesRule,omitempty"`
	// A list of rules.
	Rules []WorkloadUpdateRegularRuleInput `json:"rules,omitempty"`
}

WorkloadUpdateAutomaticStatusInput - An input object used to represent an automatic status configuration.

type WorkloadUpdateCollectionEntitySearchQueryInput added in v0.60.1

type WorkloadUpdateCollectionEntitySearchQueryInput struct {
	// The unique identifier of the entity search query to be updated. If not provided, a new entity search query is created.
	ID int `json:"id,omitempty"`
	// The entity search query that is used to perform the search of a group of entities.
	Query string `json:"query"`
}

WorkloadUpdateCollectionEntitySearchQueryInput - The input object used to represent the entity search query to be updated.

type WorkloadUpdateInput added in v0.60.1

type WorkloadUpdateInput struct {
	// Relevant information about the workload.
	Description string `json:"description,omitempty"`
	// A list of entity GUIDs composing the workload.
	EntityGUIDs []common.EntityGUID `json:"entityGuids"`
	// A list of entity search queries used to retrieve the groups of entities that compose the workload.
	EntitySearchQueries []WorkloadUpdateCollectionEntitySearchQueryInput `json:"entitySearchQueries,omitempty"`
	// The name of the workload.
	Name string `json:"name,omitempty"`
	// Accounts that will be used to get entities from.
	ScopeAccounts *WorkloadScopeAccountsInput `json:"scopeAccounts,omitempty"`
	// The configuration that defines how the status of the workload is calculated.
	StatusConfig *WorkloadUpdateStatusConfigInput `json:"statusConfig,omitempty"`
}

WorkloadUpdateInput - The input object used to identify the workload to be updated and the new values.

type WorkloadUpdateQueryResponse added in v0.60.1

type WorkloadUpdateQueryResponse struct {
	WorkloadCollection WorkloadCollection `json:"WorkloadUpdate"`
}

type WorkloadUpdateRegularRuleInput added in v0.60.1

type WorkloadUpdateRegularRuleInput struct {
	// A list of entity GUIDs composing the rule.
	EntityGUIDs []common.EntityGUID `json:"entityGuids"`
	// A list of entity search queries used to retrieve the groups of entities that compose the rule.
	EntitySearchQueries []WorkloadUpdateCollectionEntitySearchQueryInput `json:"entitySearchQueries,omitempty"`
	// The unique identifier of the rule to be updated. If not provided, a new rule is created.
	ID int `json:"id,omitempty"`
	// The input object used to represent a roll-up strategy.
	Rollup WorkloadRollupInput `json:"rollup,omitempty"`
}

WorkloadUpdateRegularRuleInput - The input object used to represent a rule.

type WorkloadUpdateStaticStatusInput added in v0.60.1

type WorkloadUpdateStaticStatusInput struct {
	// A description that provides additional details about the status of the workload.
	Description string `json:"description,omitempty"`
	// Whether the static status configuration is enabled or not.
	Enabled bool `json:"enabled"`
	// The unique identifier of the static status to be updated. If not provided, a new static status is created.
	ID int `json:"id,omitempty"`
	// The status of the workload.
	Status WorkloadStatusValueInput `json:"status"`
	// A short description of the static status.
	Summary string `json:"summary,omitempty"`
}

WorkloadUpdateStaticStatusInput - The input object used to represent the configuration of a static status.

type WorkloadUpdateStatusConfigInput added in v0.60.1

type WorkloadUpdateStatusConfigInput struct {
	// An input object used to represent an automatic status configuration.
	Automatic WorkloadUpdateAutomaticStatusInput `json:"automatic,omitempty"`
	// A list of static status configurations. You can only configure one static status for a workload.
	Static []WorkloadUpdateStaticStatusInput `json:"static,omitempty"`
}

WorkloadUpdateStatusConfigInput - The input object used to provide the configuration that defines how the status of the workload is calculated.

type WorkloadWorkloadStatus added in v0.60.1

type WorkloadWorkloadStatus struct {
	// A description that provides additional details about the status of the workload.
	Description string `json:"description,omitempty"`
	// Indicates where the status value derives from.
	Source WorkloadStatusSource `json:"source"`
	// The details of the statuses that were involved in the calculation of the workload status.
	StatusDetails []WorkloadStatusResultInterface `json:"statusDetails"`
	// A short description of the status of the workload.
	Summary string `json:"summary,omitempty"`
	// The status of the workload.
	Value WorkloadStatusValue `json:"value"`
}

WorkloadWorkloadStatus - Status of the workload.

func (*WorkloadWorkloadStatus) UnmarshalJSON added in v0.60.1

func (x *WorkloadWorkloadStatus) UnmarshalJSON(b []byte) error

special

type Workloads

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

Workloads is used to communicate with the New Relic Workloads product.

func New

func New(config config.Config) Workloads

New returns a new client for interacting with New Relic One workloads.

func (*Workloads) CreateWorkload deprecated

func (e *Workloads) CreateWorkload(accountID int, workload CreateInput) (*Workload, error)

CreateWorkload creates a New Relic One workload.

Deprecated: use WorkloadCreate instead

func (*Workloads) CreateWorkloadWithContext deprecated added in v0.60.0

func (e *Workloads) CreateWorkloadWithContext(ctx context.Context, accountID int, workload CreateInput) (*Workload, error)

CreateWorkloadWithContext creates a New Relic One workload.

Deprecated: use WorkloadCreateWithContext instead

func (*Workloads) DeleteWorkload deprecated

func (e *Workloads) DeleteWorkload(guid string) (*Workload, error)

DeleteWorkload deletes a New Relic One workload.

Deprecated: use WorkloadDelete instead

func (*Workloads) DeleteWorkloadWithContext deprecated added in v0.60.0

func (e *Workloads) DeleteWorkloadWithContext(ctx context.Context, guid string) (*Workload, error)

DeleteWorkloadWithContext deletes a New Relic One workload.

Deprecated: use WorkloadDeleteWithContext instead

func (*Workloads) DuplicateWorkload deprecated

func (e *Workloads) DuplicateWorkload(accountID int, sourceGUID string, workload *DuplicateInput) (*Workload, error)

DuplicateWorkload duplicates a New Relic One workload.

Deprecated: use WorkloadDuplicate instead

func (*Workloads) DuplicateWorkloadWithContext deprecated added in v0.60.0

func (e *Workloads) DuplicateWorkloadWithContext(ctx context.Context, accountID int, sourceGUID string, workload *DuplicateInput) (*Workload, error)

DuplicateWorkloadWithContext duplicates a New Relic One workload.

Deprecated: use WorkloadDuplicateWithContext instead

func (*Workloads) GetWorkload deprecated

func (e *Workloads) GetWorkload(accountID int, workloadGUID string) (*Workload, error)

GetWorkload retrieves a New Relic One workload by its GUID.

Deprecated: use entities.GetEntity instead

func (*Workloads) GetWorkloadWithContext deprecated added in v0.60.0

func (e *Workloads) GetWorkloadWithContext(ctx context.Context, accountID int, workloadGUID string) (*Workload, error)

GetWorkloadWithContext retrieves a New Relic One workload by its GUID.

Deprecated: use entities.GetEntityWithContext instead

func (*Workloads) ListWorkloads deprecated

func (e *Workloads) ListWorkloads(accountID int) ([]*Workload, error)

ListWorkloads retrieves a set of New Relic One workloads by their account ID.

Deprecated: use entities.GetEntities instead

func (*Workloads) ListWorkloadsWithContext deprecated added in v0.60.0

func (e *Workloads) ListWorkloadsWithContext(ctx context.Context, accountID int) ([]*Workload, error)

ListWorkloadsWithContext retrieves a set of New Relic One workloads by their account ID.

Deprecated: use entities.GetEntitiesWithContext instead

func (*Workloads) UpdateWorkload deprecated

func (e *Workloads) UpdateWorkload(guid string, workload UpdateInput) (*Workload, error)

UpdateWorkload updates a New Relic One workload.

Deprecated: use WorkloadUpdate instead

func (*Workloads) UpdateWorkloadWithContext deprecated added in v0.60.0

func (e *Workloads) UpdateWorkloadWithContext(ctx context.Context, guid string, workload UpdateInput) (*Workload, error)

UpdateWorkloadWithContext updates a New Relic One workload.

Deprecated: use WorkloadUpdateWithContext instead

func (*Workloads) WorkloadCreate added in v0.60.1

func (a *Workloads) WorkloadCreate(
	accountID int,
	workload WorkloadCreateInput,
) (*WorkloadCollection, error)

Creates a new workload.

func (*Workloads) WorkloadCreateWithContext added in v0.60.1

func (a *Workloads) WorkloadCreateWithContext(
	ctx context.Context,
	accountID int,
	workload WorkloadCreateInput,
) (*WorkloadCollection, error)

Creates a new workload.

func (*Workloads) WorkloadDelete added in v0.60.1

func (a *Workloads) WorkloadDelete(
	gUID common.EntityGUID,
) (*WorkloadCollection, error)

Deletes an existing workload.

func (*Workloads) WorkloadDeleteWithContext added in v0.60.1

func (a *Workloads) WorkloadDeleteWithContext(
	ctx context.Context,
	gUID common.EntityGUID,
) (*WorkloadCollection, error)

Deletes an existing workload.

func (*Workloads) WorkloadDuplicate added in v0.60.1

func (a *Workloads) WorkloadDuplicate(
	accountID int,
	sourceGUID common.EntityGUID,
	workload WorkloadDuplicateInput,
) (*WorkloadCollection, error)

Duplicates an existing workload.

func (*Workloads) WorkloadDuplicateWithContext added in v0.60.1

func (a *Workloads) WorkloadDuplicateWithContext(
	ctx context.Context,
	accountID int,
	sourceGUID common.EntityGUID,
	workload WorkloadDuplicateInput,
) (*WorkloadCollection, error)

Duplicates an existing workload.

func (*Workloads) WorkloadUpdate added in v0.60.1

func (a *Workloads) WorkloadUpdate(
	gUID common.EntityGUID,
	workload WorkloadUpdateInput,
) (*WorkloadCollection, error)

Updates an existing workload.

func (*Workloads) WorkloadUpdateWithContext added in v0.60.1

func (a *Workloads) WorkloadUpdateWithContext(
	ctx context.Context,
	gUID common.EntityGUID,
	workload WorkloadUpdateInput,
) (*WorkloadCollection, error)

Updates an existing workload.

Jump to

Keyboard shortcuts

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