caiasset

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	// The name, in a peculiar format: `\\<api>.googleapis.com/<self_link>`
	Name string `json:"name"`
	// The type name in `google.<api>.<resourcename>` format.
	Type          string           `json:"asset_type"`
	Resource      *AssetResource   `json:"resource,omitempty"`
	IAMPolicy     *IAMPolicy       `json:"iam_policy,omitempty"`
	OrgPolicy     []*OrgPolicy     `json:"org_policy,omitempty"`
	V2OrgPolicies []*V2OrgPolicies `json:"v2_org_policies,omitempty"`
	Ancestors     []string         `json:"ancestors"`
}

Asset is the CAI representation of a resource.

type AssetResource

type AssetResource struct {
	Version              string                 `json:"version"`
	DiscoveryDocumentURI string                 `json:"discovery_document_uri"`
	DiscoveryName        string                 `json:"discovery_name"`
	Parent               string                 `json:"parent"`
	Data                 map[string]interface{} `json:"data"`
}

AssetResource is nested within the Asset type.

type BooleanPolicy added in v2.1.0

type BooleanPolicy struct {
	Enforced bool `json:"enforced,omitempty"`
}

BooleanPolicy If `true`, then the `Policy` is enforced. If `false`, then any configuration is acceptable.

type Expr added in v2.2.0

type Expr struct {
	Expression  string `json:"expression,omitempty"`
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	Location    string `json:"location,omitempty"`
}

type IAMBinding added in v2.1.0

type IAMBinding struct {
	Role    string   `json:"role"`
	Members []string `json:"members"`
}

IAMBinding binds a role to a set of members.

type IAMPolicy added in v2.1.0

type IAMPolicy struct {
	Bindings []IAMBinding `json:"bindings"`
}

IAMPolicy is the representation of a Cloud IAM policy set on a cloud resource.

type ListPolicy added in v2.1.0

type ListPolicy struct {
	AllowedValues     []string            `json:"allowed_values,omitempty"`
	DeniedValues      []string            `json:"denied_values,omitempty"`
	AllValues         ListPolicyAllValues `json:"all_values,omitempty"`
	SuggestedValue    string              `json:"suggested_value,omitempty"`
	InheritFromParent bool                `json:"inherit_from_parent,omitempty"`
}

ListPolicy can define specific values and subtrees of Cloud Resource Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that are allowed or denied by setting the `allowed_values` and `denied_values` fields.

type ListPolicyAllValues added in v2.1.0

type ListPolicyAllValues int32

ListPolicyAllValues is used to set `Policies` that apply to all possible configuration values rather than specific values in `allowed_values` or `denied_values`.

type OrgPolicy added in v2.1.0

type OrgPolicy struct {
	Constraint     string          `json:"constraint,omitempty"`
	ListPolicy     *ListPolicy     `json:"list_policy,omitempty"`
	BooleanPolicy  *BooleanPolicy  `json:"boolean_policy,omitempty"`
	RestoreDefault *RestoreDefault `json:"restore_default,omitempty"`
	UpdateTime     *Timestamp      `json:"update_time,omitempty"`
}

OrgPolicy is for managing organization policies.

type PolicyRule added in v2.2.0

type PolicyRule struct {
	Values    *StringValues `json:"values,omitempty"`
	AllowAll  bool          `json:"allow_all,omitempty"`
	DenyAll   bool          `json:"deny_all,omitempty"`
	Enforce   bool          `json:"enforce,omitempty"`
	Condition *Expr         `json:"condition,omitempty"`
}

type PolicySpec added in v2.2.0

type PolicySpec struct {
	Etag              string        `json:"etag,omitempty"`
	UpdateTime        *Timestamp    `json:"update_time,omitempty"`
	PolicyRules       []*PolicyRule `json:"rules,omitempty"`
	InheritFromParent bool          `json:"inherit_from_parent,omitempty"`
	Reset             bool          `json:"reset,omitempty"`
}

Spec is the representation of Spec for Custom Org Policy

type RestoreDefault added in v2.1.0

type RestoreDefault struct {
}

RestoreDefault determines if the default values of the `Constraints` are active for the resources.

type StringValues added in v2.2.0

type StringValues struct {
	AllowedValues []string `json:"allowed_values,omitempty"`
	DeniedValues  []string `json:"denied_values,omitempty"`
}

type Timestamp added in v2.1.0

type Timestamp struct {
	Seconds int64 `json:"seconds,omitempty"`
	Nanos   int64 `json:"nanos,omitempty"`
}

func (Timestamp) MarshalJSON added in v2.1.0

func (t Timestamp) MarshalJSON() ([]byte, error)

func (*Timestamp) UnmarshalJSON added in v2.1.0

func (t *Timestamp) UnmarshalJSON(b []byte) error

type V2OrgPolicies added in v2.2.0

type V2OrgPolicies struct {
	Name       string      `json:"name"`
	PolicySpec *PolicySpec `json:"spec,omitempty"`
}

V2OrgPolicies is the represtation of V2OrgPolicies

Jump to

Keyboard shortcuts

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