expanders

package
Version: v1.2.132559162 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SubscriptionType defines a sub
	SubscriptionType = "subscription"

	// ResourceType defines a top level resource such as a Storage Account or VM
	ResourceType = "resource"
	// MetricsType defines an item which returns a graph
	MetricsType = "metrics"
	// SubResourceType defines a resource under a resource such as a VM Extension under a VM
	SubResourceType = "subResource"

	// ActionType defines an action like `listkey` etc
	ActionType = "action"

	// ExpandURLNotSupported is used to identify items which don't support generic expansion
	ExpandURLNotSupported = "notsupported"
)
View Source
const (
	// TentantItemType a TreeNode item representing a tenant
	TentantItemType = "tentantItemType"
)

Variables

View Source
var ItemWidgetHeight int

ItemWidgetHeight tracks height of item widget

View Source
var ItemWidgetWidth int

ItemWidgetWidth track width of item widget

Functions

func DrawStatus

func DrawStatus(s string) string

DrawStatus converts a status string to an icon

func DummyTokenFunc added in v1.2.84840979

func DummyTokenFunc() func(clearCache bool) (armclient.AzCLIToken, error)

DummyTokenFunc is used in the mock armclient

func ExpandItem

func ExpandItem(ctx context.Context, currentItem *TreeNode) (*ExpanderResponse, []*TreeNode, error)

ExpandItem finds child nodes of the item and their content

func GetActivityLogExpandURL

func GetActivityLogExpandURL(subscriptionID, resourceName string) string

GetActivityLogExpandURL gets the urls which should be used to get activity logs

func InitializeExpanders

func InitializeExpanders(client *armclient.Client)

InitializeExpanders create instances of all the expanders needed by the app

Types

type APISetExpandResponse

type APISetExpandResponse struct {
	Response      string
	ResponseType  ExpanderResponseType
	SubResources  []SubResource
	ChildMetadata map[string]string
}

APISetExpandResponse returns the result of expanding a Resource

type ActionExpander

type ActionExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

ActionExpander handles actions

func (*ActionExpander) DoesExpand

func (e *ActionExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if it is an action

func (*ActionExpander) Expand

func (e *ActionExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult

Expand performs the action

func (*ActionExpander) Name

func (e *ActionExpander) Name() string

Name returns the name of the expander

type ActivityLogExpander

type ActivityLogExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

ActivityLogExpander expands activity logs under an RG

func (*ActivityLogExpander) DoesExpand

func (e *ActivityLogExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is an RG

func (*ActivityLogExpander) Expand

func (e *ActivityLogExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult

Expand returns Resources in the RG

func (*ActivityLogExpander) Name

func (e *ActivityLogExpander) Name() string

Name returns the name of the expander

type ActivityLogResource

type ActivityLogResource struct {
	Value []struct {
		Authorization struct {
			Action string `json:"action"`
			Scope  string `json:"scope"`
		} `json:"authorization"`
		Caller   string `json:"caller"`
		Channels string `json:"channels"`
		Claims   struct {
			Aud                                                       string `json:"aud"`
			Iss                                                       string `json:"iss"`
			Iat                                                       string `json:"iat"`
			Nbf                                                       string `json:"nbf"`
			Exp                                                       string `json:"exp"`
			Aio                                                       string `json:"aio"`
			Appid                                                     string `json:"appid"`
			Appidacr                                                  string `json:"appidacr"`
			HTTPSchemasMicrosoftComIdentityClaimsIdentityprovider     string `json:"http://schemas.microsoft.com/identity/claims/identityprovider"`
			HTTPSchemasMicrosoftComIdentityClaimsObjectidentifier     string `json:"http://schemas.microsoft.com/identity/claims/objectidentifier"`
			HTTPSchemasXmlsoapOrgWs200505IdentityClaimsNameidentifier string `json:"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"`
			HTTPSchemasMicrosoftComIdentityClaimsTenantid             string `json:"http://schemas.microsoft.com/identity/claims/tenantid"`
			Uti                                                       string `json:"uti"`
			Ver                                                       string `json:"ver"`
		} `json:"claims"`
		CorrelationID string `json:"correlationId"`
		Description   string `json:"description"`
		EventDataID   string `json:"eventDataId"`
		EventName     struct {
			Value          string `json:"value"`
			LocalizedValue string `json:"localizedValue"`
		} `json:"eventName"`
		Category struct {
			Value          string `json:"value"`
			LocalizedValue string `json:"localizedValue"`
		} `json:"category"`
		ID                   string `json:"id"`
		Level                string `json:"level"`
		ResourceGroupName    string `json:"resourceGroupName"`
		ResourceProviderName struct {
			Value          string `json:"value"`
			LocalizedValue string `json:"localizedValue"`
		} `json:"resourceProviderName"`
		ResourceID   string `json:"resourceId"`
		ResourceType struct {
			Value          string `json:"value"`
			LocalizedValue string `json:"localizedValue"`
		} `json:"resourceType"`
		OperationID   string `json:"operationId"`
		OperationName struct {
			Value          string `json:"value"`
			LocalizedValue string `json:"localizedValue"`
		} `json:"operationName"`
		Properties struct {
			IsComplianceCheck string `json:"isComplianceCheck"`
			ResourceLocation  string `json:"resourceLocation"`
			Ancestors         string `json:"ancestors"`
			Policies          string `json:"policies"`
		} `json:"properties,omitempty"`
		Status struct {
			Value          string `json:"value"`
			LocalizedValue string `json:"localizedValue"`
		} `json:"status"`
		SubStatus struct {
			Value          string `json:"value"`
			LocalizedValue string `json:"localizedValue"`
		} `json:"subStatus"`
		EventTimestamp      time.Time `json:"eventTimestamp"`
		SubmissionTimestamp time.Time `json:"submissionTimestamp"`
		SubscriptionID      string    `json:"subscriptionId"`
		TenantID            string    `json:"tenantId"`
		HTTPRequest         struct {
			ClientRequestID string `json:"clientRequestId"`
			ClientIPAddress string `json:"clientIpAddress"`
			Method          string `json:"method"`
		} `json:"httpRequest,omitempty"`
	} `json:"value"`
}

ActivityLogResource is returned when requesting activity logs for an RG

type AppInsightsExpander

type AppInsightsExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

AppInsightsExpander expands aspects of App Insights that don't naturally flow from the api spec

func (*AppInsightsExpander) DoesExpand

func (e *AppInsightsExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is a node we should extend

func (*AppInsightsExpander) Expand

func (e *AppInsightsExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult

Expand returns nodes for App Insights

func (*AppInsightsExpander) Name

func (e *AppInsightsExpander) Name() string

Name returns the name of the expander

type AzureDatabricksExpander added in v1.2.104948434

type AzureDatabricksExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

AzureDatabricksExpander expands the kubernetes aspects of AKS

func (AzureDatabricksExpander) Delete added in v1.2.104948434

func (e AzureDatabricksExpander) Delete(ctx context.Context, item *TreeNode) (bool, error)

Delete attempts to delete the item. Returns true if deleted, false if not handled, an error if an error occurred attempting to delete

func (*AzureDatabricksExpander) DoesExpand added in v1.2.104948434

func (e *AzureDatabricksExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is a storage account

func (*AzureDatabricksExpander) Expand added in v1.2.104948434

func (e *AzureDatabricksExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult

Expand returns the SwaggerExpander set up for this Databricks workspace

func (*AzureDatabricksExpander) Name added in v1.2.104948434

func (e *AzureDatabricksExpander) Name() string

Name returns the name of the expander

type AzureKubernetesServiceExpander

type AzureKubernetesServiceExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

AzureKubernetesServiceExpander expands the kubernetes aspects of AKS

func (*AzureKubernetesServiceExpander) DoesExpand

func (e *AzureKubernetesServiceExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is a storage account

func (*AzureKubernetesServiceExpander) Expand

Expand returns ManagementPolicies in the StorageAccount

func (*AzureKubernetesServiceExpander) Name

Name returns the name of the expander

type AzureSearchServiceExpander added in v1.1.398

type AzureSearchServiceExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

AzureSearchServiceExpander expands the kubernetes aspects of AKS

func (AzureSearchServiceExpander) Delete added in v1.1.398

func (e AzureSearchServiceExpander) Delete(ctx context.Context, item *TreeNode) (bool, error)

Delete attempts to delete the item. Returns true if deleted, false if not handled, an error if an error occurred attempting to delete

func (*AzureSearchServiceExpander) DoesExpand added in v1.1.398

func (e *AzureSearchServiceExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is a storage account

func (*AzureSearchServiceExpander) Expand added in v1.1.398

func (e *AzureSearchServiceExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult

Expand returns ManagementPolicies in the StorageAccount

func (*AzureSearchServiceExpander) Name added in v1.1.398

Name returns the name of the expander

type ContainerGroupResponse

type ContainerGroupResponse struct {
	ID         string `json:"id"`
	Location   string `json:"location"`
	Name       string `json:"name"`
	Properties struct {
		Containers []struct {
			Name       string `json:"name"`
			Properties struct {
				Command              []interface{} `json:"command"`
				EnvironmentVariables []interface{} `json:"environmentVariables"`
				Image                string        `json:"image"`
				Ports                []struct {
					Port int `json:"port"`
				} `json:"ports"`
				InstanceView struct {
					RestartCount int `json:"restartCount"`
					CurrentState struct {
						State        string    `json:"state"`
						StartTime    time.Time `json:"startTime"`
						DetailStatus string    `json:"detailStatus"`
					} `json:"currentState"`
					Events []struct {
						Count          int       `json:"count"`
						FirstTimestamp time.Time `json:"firstTimestamp"`
						LastTimestamp  time.Time `json:"lastTimestamp"`
						Name           string    `json:"name"`
						Message        string    `json:"message"`
						Type           string    `json:"type"`
					} `json:"events"`
				} `json:"instanceView"`
				Resources struct {
					Requests struct {
						CPU        float64 `json:"cpu"`
						MemoryInGB float64 `json:"memoryInGB"`
					} `json:"requests"`
				} `json:"resources"`
				VolumeMounts []struct {
					MountPath string `json:"mountPath"`
					Name      string `json:"name"`
					ReadOnly  bool   `json:"readOnly"`
				} `json:"volumeMounts"`
			} `json:"properties"`
		} `json:"containers"`
		ImageRegistryCredentials []struct {
			Server   string `json:"server"`
			Username string `json:"username"`
		} `json:"imageRegistryCredentials"`
		IPAddress struct {
			IP    string `json:"ip"`
			Ports []struct {
				Port     int    `json:"port"`
				Protocol string `json:"protocol"`
			} `json:"ports"`
			Type string `json:"type"`
		} `json:"ipAddress"`
		OsType            string `json:"osType"`
		ProvisioningState string `json:"provisioningState"`
		Volumes           []struct {
			AzureFile struct {
				ReadOnly           bool   `json:"readOnly"`
				ShareName          string `json:"shareName"`
				StorageAccountName string `json:"storageAccountName"`
			} `json:"azureFile"`
			Name string `json:"name"`
		} `json:"volumes"`
	} `json:"properties"`
	Type string `json:"type"`
}

ContainerGroupResponse is the response to a get request on a container group

type ContainerInstanceExpander

type ContainerInstanceExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

ContainerInstanceExpander expands the data-plane aspects of a Container Instance

func (*ContainerInstanceExpander) DoesExpand

func (e *ContainerInstanceExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is a storage account

func (*ContainerInstanceExpander) Expand

func (e *ContainerInstanceExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult

Expand adds items for container instance items to the list

func (*ContainerInstanceExpander) Name

Name returns the name of the expander

type ContainerLogResponse

type ContainerLogResponse struct {
	Content string `json:"content"`
}

ContainerLogResponse for container logs

type ContainerRegistryExpander

type ContainerRegistryExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

ContainerRegistryExpander expands Tthe data-plane aspects of a Container Registry

func NewContainerRegistryExpander

func NewContainerRegistryExpander(armclient *armclient.Client) *ContainerRegistryExpander

NewContainerRegistryExpander creates a new instance of ContainerRegistryExpander

func (*ContainerRegistryExpander) Delete added in v1.1.467

func (e *ContainerRegistryExpander) Delete(ctx context.Context, currentItem *TreeNode) (bool, error)

Delete attempts to delete the item. Returns true if deleted, false if not handled, an error if an error occurred attempting to delete

func (*ContainerRegistryExpander) DoesExpand

func (e *ContainerRegistryExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is a storage account

func (*ContainerRegistryExpander) Expand

func (e *ContainerRegistryExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult

Expand returns ManagementPolicies in the StorageAccount

func (*ContainerRegistryExpander) Name

Name returns the name of the expander

type DatabricksAPIResponseMetadata added in v1.2.110665552

type DatabricksAPIResponseMetadata struct {
	// ResponseArrayPath is the path to the array of items in the JSON response
	ResponseArrayPath string
	// ResponseArrayPath is name of the identified property for items in the JSON response
	ResponseIDPropertyName string
	// SubResourceQueryStringName is the name of the query string parameter to identify an item in sub resource requests ()
	SubResourceQueryStringName string
	// ResponsePropertyMappings holds details for properties to extra from the response object into item metadata
	ResponsePropertyMappings []ResponsePropertyMapping
	// SubResourceQueryStringValues is an array of query string parameters to populate from item metadata (this includes the SubResourceQueryStringName)
	SubResourceQueryStringValues []string
}

DatabricksAPIResponseMetadata describes how to process responses from the Databricks API

func NewDatabricksAPIResponseMetadata added in v1.2.110665552

func NewDatabricksAPIResponseMetadata(responseArrayPath string, responseIDPropertyName string, subResourceQueryStringName string, subResourceAdditionalMetadata []string) DatabricksAPIResponseMetadata

NewDatabricksAPIResponseMetadata creates a DatabricksAPIResponseMetadata instance

type DatabricksWorkspaceGetStatusResponse added in v1.2.110665552

type DatabricksWorkspaceGetStatusResponse struct {
	Path       string `json:"path"`
	Language   string `json:"language"`
	ObjectType string `json:"object_type"`
	ObjectID   string `jsong:"object_id"`
}

type DefaultExpander

type DefaultExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

DefaultExpander expands RGs under a subscription

func GetDefaultExpander added in v1.1.452

func GetDefaultExpander() *DefaultExpander

GetDefaultExpander returns the (singleton) instance of DefaultExpander

func (*DefaultExpander) DoesExpand

func (e *DefaultExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this handler can expand this item

func (*DefaultExpander) Expand

func (e *DefaultExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult

Expand returns resource

func (*DefaultExpander) Name

func (e *DefaultExpander) Name() string

Name returns the name of the expander

type DeploymentOperationsResponse

type DeploymentOperationsResponse struct {
	Value []struct {
		ID          string `json:"id"`
		OperationID string `json:"operationId"`
		Properties  struct {
			StatusCode            string      `json:"statusCode"`
			StatusMessage         interface{} `json:"statusMessage"`
			Timestamp             string      `json:"timestamp"`
			Duration              string      `json:"duration"`
			ProvisioningOperation string      `json:"provisioningOperation"`
			ProvisioningState     string      `json:"provisioningState"`
			TrackingID            string      `json:"trackingId"`
			TargetResource        struct {
				ID           string `json:"id"`
				ResourceType string `json:"resourceType"`
				ResourceName string `json:"resourceName"`
			} `json:"targetResource"`
		} `json:"properties"`
	} `json:"value"`
}

DeploymentOperationsResponse is a struct to enable splitting out json value array

type DeploymentsExpander

type DeploymentsExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

DeploymentsExpander expands RGs under a subscription

func (*DeploymentsExpander) DoesExpand

func (e *DeploymentsExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is an RG

func (*DeploymentsExpander) Expand

func (e *DeploymentsExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult

Expand returns Resources in the RG

func (*DeploymentsExpander) Name

func (e *DeploymentsExpander) Name() string

Name returns the name of the expander

type DeploymentsResponse

type DeploymentsResponse struct {
	Value []struct {
		ID         string `json:"id"`
		Name       string `json:"name"`
		Properties struct {
			CorrelationID string `json:"correlationId"`
			Dependencies  []struct {
				DependsOn []struct {
					ID           string `json:"id"`
					ResourceName string `json:"resourceName"`
					ResourceType string `json:"resourceType"`
				} `json:"dependsOn"`
				ID           string `json:"id"`
				ResourceName string `json:"resourceName"`
				ResourceType string `json:"resourceType"`
			} `json:"dependencies"`
			Duration        string `json:"duration"`
			Mode            string `json:"mode"`
			OutputResources []struct {
				ID string `json:"id"`
			} `json:"outputResources"`
			Outputs    map[string]interface{} `json:"outputs"`
			Parameters map[string]interface{} `json:"parameters"`
			Providers  []struct {
				Namespace     string `json:"namespace"`
				ResourceTypes []struct {
					Locations    []string `json:"locations"`
					ResourceType string   `json:"resourceType"`
				} `json:"resourceTypes"`
			} `json:"providers"`
			ProvisioningState string                 `json:"provisioningState"`
			TemplateHash      string                 `json:"templateHash"`
			Template          map[string]interface{} `json:"template"`
			TemplateLink      struct {
				ContentVersion string `json:"contentVersion"`
				URI            string `json:"uri"`
			} `json:"templateLink"`
			Timestamp string `json:"timestamp"`
		} `json:"properties"`
	} `json:"value"`
}

DeploymentsResponse is returned by a request for deployments in an RG

type Expander

type Expander interface {
	DoesExpand(ctx context.Context, currentNode *TreeNode) (bool, error)
	Expand(ctx context.Context, currentNode *TreeNode) ExpanderResult
	Name() string
	Delete(context context.Context, item *TreeNode) (bool, error)
	// contains filtered or unexported methods
}

Expander is used to open/expand items in the left list panel a single item can be expanded by 1 or more expanders each Expander provides two methods. `DoesExpand` should return true if this expander can expand the resource `Expand` returns the list of sub items from the resource

type ExpanderBase added in v1.1.467

type ExpanderBase struct{}

ExpanderBase provides nil implementations of Expander methods to avoid duplicating code

func (*ExpanderBase) Delete added in v1.1.467

func (e *ExpanderBase) Delete(context context.Context, item *TreeNode) (bool, error)

Delete attempts to delete the item. Returns true if deleted, false if not handled, an error if an error occurred attempting to delete

type ExpanderResponse

type ExpanderResponse struct {
	Response     string               // the response text
	ResponseType ExpanderResponseType // the response
}

ExpanderResponse captures the response text and formt of an expander response

type ExpanderResponseType

type ExpanderResponseType string

ExpanderResponseType is used to indicate the text format of a response

const (
	// ResponsePlainText indicates the response type should not be parsed or colourised
	ResponsePlainText ExpanderResponseType = "Text"
	// ResponseJSON indicates the response type can be parsed and colourised as JSON
	ResponseJSON ExpanderResponseType = "JSON"
	// ResponseYAML indicates the response type can be parsed and colourised as YAML
	ResponseYAML ExpanderResponseType = "YAML"
)

type ExpanderResult

type ExpanderResult struct {
	Response          ExpanderResponse
	Nodes             []*TreeNode
	Err               error
	SourceDescription string
	// When set to true this causes the response
	// in the result to be displayed in the content panel
	IsPrimaryResponse bool
}

ExpanderResult used to wrap mult-value return for use in channels

type JSONExpander

type JSONExpander struct {
	ExpanderBase
}

JSONExpander expands an item with "jsonItem" in its metadata

func (*JSONExpander) DoesExpand

func (e *JSONExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is an RG

func (*JSONExpander) Expand

func (e *JSONExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult

Expand returns Resources in the RG

func (*JSONExpander) Name

func (e *JSONExpander) Name() string

Name returns the name of the expander

type MetricsExpander

type MetricsExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

MetricsExpander expands the data-plane aspects of the Microsoft.Insights RP

func (*MetricsExpander) DoesExpand

func (e *MetricsExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is a storage account

func (*MetricsExpander) Expand

func (e *MetricsExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult

Expand adds items for metrics to the list

func (*MetricsExpander) Name

func (e *MetricsExpander) Name() string

Name returns the name of the expander

type ResourceGroupResourceExpander

type ResourceGroupResourceExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

ResourceGroupResourceExpander expands resource under an RG

func (*ResourceGroupResourceExpander) DoesExpand

func (e *ResourceGroupResourceExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is an RG

func (*ResourceGroupResourceExpander) Expand

Expand returns Resources in the RG

func (*ResourceGroupResourceExpander) Name

Name returns the name of the expander

type ResourceGroupResponse

type ResourceGroupResponse struct {
	Groups []struct {
		ID         string `json:"id"`
		Name       string `json:"name"`
		Location   string `json:"location"`
		Properties struct {
			ProvisioningState string `json:"provisioningState"`
		} `json:"properties"`
	} `json:"value"`
}

ResourceGroupResponse ResourceGroup rest type

type ResponsePropertyMapping added in v1.2.110665552

type ResponsePropertyMapping struct {
	// ResponsePropertyName is the name of the property used to look up a value in the response object
	ResponsePropertyName string
	// MetadataName is the name of the key to use to store the value in the item metadata
	MetadataName string
}

ResponsePropertyMapping stores the mapping from response property name to Metadata item name

type StorageManagementPoliciesExpander

type StorageManagementPoliciesExpander struct {
	ExpanderBase
}

StorageManagementPoliciesExpander expands The default management policy under a storage account

func (*StorageManagementPoliciesExpander) DoesExpand

func (e *StorageManagementPoliciesExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is a storage account

func (*StorageManagementPoliciesExpander) Expand

Expand returns ManagementPolicies in the StorageAccount

func (*StorageManagementPoliciesExpander) Name

Name returns the name of the expander

type SubResource

type SubResource struct {
	ID           string
	Name         string
	ResourceType swagger.ResourceType
	ExpandURL    string
	DeleteURL    string
	Metadata     map[string]string
}

SubResource is used to pass sub resource information from SwaggerAPISet to the expander

type SubResponse

type SubResponse struct {
	Subs []struct {
		ID                   string `json:"id"`
		SubscriptionID       string `json:"subscriptionId"`
		DisplayName          string `json:"displayName"`
		State                string `json:"state"`
		SubscriptionPolicies struct {
			LocationPlacementID string `json:"locationPlacementId"`
			QuotaID             string `json:"quotaId"`
			SpendingLimit       string `json:"spendingLimit"`
		} `json:"subscriptionPolicies"`
	} `json:"value"`
}

SubResponse Subscriptions REST type

type SubscriptionExpander

type SubscriptionExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

SubscriptionExpander expands RGs under a subscription

func (*SubscriptionExpander) DoesExpand

func (e *SubscriptionExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is an RG

func (*SubscriptionExpander) Expand

func (e *SubscriptionExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult

Expand returns Resources in the RG

func (*SubscriptionExpander) Name

func (e *SubscriptionExpander) Name() string

Name returns the name of the expander

type SwaggerAPISet

type SwaggerAPISet interface {
	ID() string
	GetResourceTypes() []swagger.ResourceType
	AppliesToNode(node *TreeNode) bool
	ExpandResource(context context.Context, node *TreeNode, resourceType swagger.ResourceType) (APISetExpandResponse, error)
	MatchChildNodesByName() bool
	Delete(context context.Context, node *TreeNode) (bool, error)
	Update(context context.Context, node *TreeNode, content string) error
}

SwaggerAPISet represents the configuration for a set of swagger API endpoints that the SwaggerResourceExpander can handle

type SwaggerAPISetARMResources

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

SwaggerAPISetARMResources holds the config for working with ARM resources as per the published Swagger specs

func NewSwaggerAPISetARMResources

func NewSwaggerAPISetARMResources(client *armclient.Client) SwaggerAPISetARMResources

NewSwaggerAPISetARMResources creates a new SwaggerAPISetARMResources

func (SwaggerAPISetARMResources) AppliesToNode

func (c SwaggerAPISetARMResources) AppliesToNode(node *TreeNode) bool

AppliesToNode is called by the Swagger exapnder to test whether the node applies to this APISet

func (SwaggerAPISetARMResources) Delete

func (c SwaggerAPISetARMResources) Delete(ctx context.Context, item *TreeNode) (bool, error)

Delete attempts to delete the item. Returns true if deleted, false if not handled, an error if an error occurred attempting to delete

func (SwaggerAPISetARMResources) ExpandResource

func (c SwaggerAPISetARMResources) ExpandResource(ctx context.Context, currentItem *TreeNode, resourceType swagger.ResourceType) (APISetExpandResponse, error)

ExpandResource returns metadata about child resources of the specified resource node

func (SwaggerAPISetARMResources) GetResourceTypes

func (c SwaggerAPISetARMResources) GetResourceTypes() []swagger.ResourceType

GetResourceTypes returns the ResourceTypes for the API Set

func (SwaggerAPISetARMResources) ID

ID returns the ID for the APISet

func (SwaggerAPISetARMResources) MatchChildNodesByName

func (c SwaggerAPISetARMResources) MatchChildNodesByName() bool

MatchChildNodesByName indicates whether child nodes should be matched by name (or position)

func (SwaggerAPISetARMResources) Update

func (c SwaggerAPISetARMResources) Update(ctx context.Context, item *TreeNode, content string) error

Update attempts to update the specified item with new content

type SwaggerAPISetContainerService

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

SwaggerAPISetContainerService holds the config for working with an AKS cluster API

func NewSwaggerAPISetContainerService

func NewSwaggerAPISetContainerService(resourceTypes []swagger.ResourceType, httpClient http.Client, clusterID string, serverURL string) SwaggerAPISetContainerService

NewSwaggerAPISetContainerService creates a new SwaggerAPISetContainerService

func (SwaggerAPISetContainerService) AppliesToNode

func (c SwaggerAPISetContainerService) AppliesToNode(node *TreeNode) bool

AppliesToNode is called by the Swagger exapnder to test whether the node applies to this APISet

func (SwaggerAPISetContainerService) Delete

Delete attempts to delete the item. Returns true if deleted, false if not handled, an error if an error occurred attempting to delete

func (SwaggerAPISetContainerService) ExpandResource

func (c SwaggerAPISetContainerService) ExpandResource(ctx context.Context, currentItem *TreeNode, resourceType swagger.ResourceType) (APISetExpandResponse, error)

ExpandResource returns metadata about child resources of the specified resource node

func (SwaggerAPISetContainerService) GetResourceTypes

func (c SwaggerAPISetContainerService) GetResourceTypes() []swagger.ResourceType

GetResourceTypes returns the ResourceTypes for the API Set

func (SwaggerAPISetContainerService) ID

ID returns the ID for the APISet

func (SwaggerAPISetContainerService) MatchChildNodesByName

func (c SwaggerAPISetContainerService) MatchChildNodesByName() bool

MatchChildNodesByName indicates whether child nodes should be matched by name (or position)

func (SwaggerAPISetContainerService) Update

func (c SwaggerAPISetContainerService) Update(ctx context.Context, item *TreeNode, content string) error

Update attempts to update the specified item with new content

type SwaggerAPISetDatabricks added in v1.2.104948434

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

SwaggerAPISetDatabricks holds the config for working with an Azure Search Service

func NewSwaggerAPISetDatabricks added in v1.2.104948434

func NewSwaggerAPISetDatabricks(resourceTypes []swagger.ResourceType, workspaceID string, nodeID string, workspaceURL string, managementToken string, databricksToken string) SwaggerAPISetDatabricks

NewSwaggerAPISetDatabricks creates a new SwaggerAPISetDatabricks

func (SwaggerAPISetDatabricks) AppliesToNode added in v1.2.104948434

func (c SwaggerAPISetDatabricks) AppliesToNode(node *TreeNode) bool

AppliesToNode is called by the Swagger exapnder to test whether the node applies to this APISet

func (SwaggerAPISetDatabricks) Delete added in v1.2.104948434

func (c SwaggerAPISetDatabricks) Delete(ctx context.Context, item *TreeNode) (bool, error)

Delete attempts to delete the item. Returns true if deleted, false if not handled, an error if an error occurred attempting to delete

func (SwaggerAPISetDatabricks) DoRequest added in v1.2.104948434

func (c SwaggerAPISetDatabricks) DoRequest(verb string, url string) (string, error)

DoRequest makes a request against the search endpoint

func (SwaggerAPISetDatabricks) DoRequestWithBody added in v1.2.104948434

func (c SwaggerAPISetDatabricks) DoRequestWithBody(verb string, url string, body string) (string, error)

DoRequestWithBody makes a request against the search endpoint

func (SwaggerAPISetDatabricks) DoRequestWithBodyAndHeaders added in v1.2.104948434

func (c SwaggerAPISetDatabricks) DoRequestWithBodyAndHeaders(verb string, url string, body string, headers map[string]string) (string, error)

DoRequestWithBodyAndHeaders makes a request against the search endpoint

func (SwaggerAPISetDatabricks) ExpandResource added in v1.2.104948434

func (c SwaggerAPISetDatabricks) ExpandResource(ctx context.Context, currentItem *TreeNode, resourceType swagger.ResourceType) (APISetExpandResponse, error)

ExpandResource returns metadata about child resources of the specified resource node

func (SwaggerAPISetDatabricks) GetResourceTypes added in v1.2.104948434

func (c SwaggerAPISetDatabricks) GetResourceTypes() []swagger.ResourceType

GetResourceTypes returns the ResourceTypes for the API Set

func (SwaggerAPISetDatabricks) ID added in v1.2.104948434

ID returns the ID for the APISet

func (SwaggerAPISetDatabricks) MatchChildNodesByName added in v1.2.104948434

func (c SwaggerAPISetDatabricks) MatchChildNodesByName() bool

MatchChildNodesByName indicates whether child nodes should be matched by name (or position)

func (SwaggerAPISetDatabricks) Update added in v1.2.104948434

func (c SwaggerAPISetDatabricks) Update(ctx context.Context, item *TreeNode, content string) error

Update attempts to update the specified item with new content

type SwaggerAPISetSearch added in v1.1.398

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

SwaggerAPISetSearch holds the config for working with an Azure Search Service

func NewSwaggerAPISetSearch added in v1.1.398

func NewSwaggerAPISetSearch(resourceTypes []swagger.ResourceType, searchID string, searchEndpoint string, adminKey string) SwaggerAPISetSearch

NewSwaggerAPISetSearch creates a new SwaggerAPISetSearch

func (SwaggerAPISetSearch) AppliesToNode added in v1.1.398

func (c SwaggerAPISetSearch) AppliesToNode(node *TreeNode) bool

AppliesToNode is called by the Swagger exapnder to test whether the node applies to this APISet

func (SwaggerAPISetSearch) Delete added in v1.1.398

func (c SwaggerAPISetSearch) Delete(ctx context.Context, item *TreeNode) (bool, error)

Delete attempts to delete the item. Returns true if deleted, false if not handled, an error if an error occurred attempting to delete

func (SwaggerAPISetSearch) DoRequest added in v1.1.427

func (c SwaggerAPISetSearch) DoRequest(verb string, url string) (string, error)

DoRequest makes a request against the search endpoint

func (SwaggerAPISetSearch) DoRequestWithBody added in v1.1.427

func (c SwaggerAPISetSearch) DoRequestWithBody(verb string, url string, body string) (string, error)

DoRequestWithBody makes a request against the search endpoint

func (SwaggerAPISetSearch) DoRequestWithBodyAndHeaders added in v1.1.427

func (c SwaggerAPISetSearch) DoRequestWithBodyAndHeaders(verb string, url string, body string, headers map[string]string) (string, error)

DoRequestWithBodyAndHeaders makes a request against the search endpoint

func (SwaggerAPISetSearch) ExpandResource added in v1.1.398

func (c SwaggerAPISetSearch) ExpandResource(ctx context.Context, currentItem *TreeNode, resourceType swagger.ResourceType) (APISetExpandResponse, error)

ExpandResource returns metadata about child resources of the specified resource node

func (SwaggerAPISetSearch) GetResourceTypes added in v1.1.398

func (c SwaggerAPISetSearch) GetResourceTypes() []swagger.ResourceType

GetResourceTypes returns the ResourceTypes for the API Set

func (SwaggerAPISetSearch) ID added in v1.1.398

func (c SwaggerAPISetSearch) ID() string

ID returns the ID for the APISet

func (SwaggerAPISetSearch) MatchChildNodesByName added in v1.1.398

func (c SwaggerAPISetSearch) MatchChildNodesByName() bool

MatchChildNodesByName indicates whether child nodes should be matched by name (or position)

func (SwaggerAPISetSearch) Update added in v1.1.398

func (c SwaggerAPISetSearch) Update(ctx context.Context, item *TreeNode, content string) error

Update attempts to update the specified item with new content

type SwaggerResourceExpander

type SwaggerResourceExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

SwaggerResourceExpander expands resource under an AppService

func GetSwaggerResourceExpander

func GetSwaggerResourceExpander() *SwaggerResourceExpander

GetSwaggerResourceExpander returns the (singleton) instance of SwaggerResourceExpander

func NewSwaggerResourcesExpander

func NewSwaggerResourcesExpander() *SwaggerResourceExpander

NewSwaggerResourcesExpander creates a new SwaggerResourceExpander

func (*SwaggerResourceExpander) AddAPISet

func (e *SwaggerResourceExpander) AddAPISet(apiSet SwaggerAPISet)

AddAPISet adds a SwaggerAPISet to the APIs that the expander will handle

func (*SwaggerResourceExpander) Delete

func (e *SwaggerResourceExpander) Delete(context context.Context, item *TreeNode) (bool, error)

Delete attempts to delete the item. Returns true if deleted, false if not handled, an error if an error occurred attempting to delete

func (*SwaggerResourceExpander) DoesExpand

func (e *SwaggerResourceExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is an RG

func (*SwaggerResourceExpander) Expand

func (e *SwaggerResourceExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult

Expand returns Resources in the RG

func (*SwaggerResourceExpander) GetAPISet

func (e *SwaggerResourceExpander) GetAPISet(id string) *SwaggerAPISet

GetAPISet returns a SwaggerAPISet by id

func (*SwaggerResourceExpander) Name

func (e *SwaggerResourceExpander) Name() string

Name returns the name of the expander

type TenantExpander

type TenantExpander struct {
	ExpanderBase
	// contains filtered or unexported fields
}

TenantExpander expands the subscriptions under a tenant

func (*TenantExpander) DoesExpand

func (e *TenantExpander) DoesExpand(ctx context.Context, currentItem *TreeNode) (bool, error)

DoesExpand checks if this is an RG

func (*TenantExpander) Expand

func (e *TenantExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult

Expand returns Resources in the RG

func (*TenantExpander) Name

func (e *TenantExpander) Name() string

Name returns the name of the expander

type TreeNode

type TreeNode struct {
	Parentid            string                // The ID of the parent resource
	ID                  string                // The ID of the resource in ARM
	Name                string                // The name of the object returned by the API
	Display             string                // The Text used to draw the object in the list
	ExpandURL           string                // The URL to call to expand the item
	ItemType            string                // The type of item either subscription, resourcegroup, resource, deployment or action
	ExpandReturnType    string                // The type of the items returned by the expandURL
	DeleteURL           string                // The URL to call to delete the current resource
	Namespace           string                // The ARM Namespace of the item eg StorageAccount
	ArmType             string                // The ARM type of the item eg Microsoft.Storage/StorageAccount
	Metadata            map[string]string     // Metadata is used to pass arbritray data between `Expander`'s
	SubscriptionID      string                // The SubId of this item
	StatusIndicator     string                // Displays the resources status
	SwaggerResourceType *swagger.ResourceType // caches the swagger ResourceType to avoid repeated lookups
	Expander            Expander              // The Expander that created the node (set automatically by the list)
}

TreeNode is an item in the ListWidget

Jump to

Keyboard shortcuts

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