servicefabric

package module
v0.0.2-0...-c340047 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: MIT Imports: 7 Imported by: 0

README

Unofficial Service Fabric Management SDK for Golang

Build Status godoc

This SDK provides a subset of methods to use the REST Service Fabric Client APIs

This is not an SDK for developing Service Fabric applications with Golang.

Documentation

Index

Constants

View Source
const DefaultAPIVersion = "6.0"

DefaultAPIVersion is a default Service Fabric REST API version

Variables

View Source
var ErrResourceNotExists = errors.New("service fabric resource does not exist")
View Source
var ErrResourceNotFound = errors.New("service fabric resourcenot found")

Functions

This section is empty.

Types

type AppParameter

type AppParameter struct {
	Key   string `json:"Key"`
	Value string `json:"Value"`
}

AppParameter Application parameter

type ApplicationItem

type ApplicationItem struct {
	HealthState string          `json:"HealthState"`
	ID          string          `json:"Id"`
	Name        string          `json:"Name"`
	Parameters  []*AppParameter `json:"Parameters"`
	Status      string          `json:"Status"`
	TypeName    string          `json:"TypeName"`
	TypeVersion string          `json:"TypeVersion"`
}

ApplicationItem encapsulates the embedded model for ApplicationItems within the ApplicationItemsPage model

type ApplicationItemsPage

type ApplicationItemsPage struct {
	ContinuationToken *string           `json:"ContinuationToken"`
	Items             []ApplicationItem `json:"Items"`
}

ApplicationItemsPage encapsulates the paged response model for Applications in the Service Fabric API

type ClusterManifest

type ClusterManifest struct {
	XMLName        xml.Name       `xml:"ClusterManifest"`
	FabricSettings FabricSettings `xml:"FabricSettings"`
}

type ClusterManifestWrapper

type ClusterManifestWrapper struct {
	Manifest string `json:"Manifest"`
}

ClusterManifest represents the cluster manifest json file

type ConfigurationEpoch

type ConfigurationEpoch struct {
	ConfigurationVersion string `json:"ConfigurationVersion"`
	DataLossVersion      string `json:"DataLossVersion"`
}

ConfigurationEpoch Partition configuration epoch

type FabricSettings

type FabricSettings struct {
	XMLName  xml.Name `xml:"FabricSettings"`
	Sections []struct {
		//XMLName xml.Name `xml:"Section"`
		Name       string `xml:"Name,attr"`
		Parameters []struct {
			Name  string `xml:"Name,attr"`
			Value string `xml:"Value,attr"`
		} `xml:"Parameter"`
	} `xml:"Section"`
}

type InstanceItem

type InstanceItem struct {
	*ReplicaItemBase
	ID string `json:"InstanceId"`
}

InstanceItem hold instance specific data

func (*InstanceItem) GetReplicaData

func (m *InstanceItem) GetReplicaData() (string, *ReplicaItemBase)

GetReplicaData returns replica data from an instance

type InstanceItemsPage

type InstanceItemsPage struct {
	ContinuationToken *string        `json:"ContinuationToken"`
	Items             []InstanceItem `json:"Items"`
}

InstanceItemsPage encapsulates the response model for Instances in the Service Fabric API

type KeyValuePair

type KeyValuePair struct {
	Key   string `json:"Key"`
	Value string `json:"Value"`
}

KeyValuePair represents a key value pair structure

type Metadata

type Metadata struct {
	CustomTypeID             string `json:"CustomTypeId"`
	LastModifiedUtcTimestamp string `json:"LastModifiedUtcTimestamp"`
	Parent                   string `json:"Parent"`
	SequenceNumber           string `json:"SequenceNumber"`
	SizeInBytes              int64  `json:"SizeInBytes"`
	TypeID                   string `json:"TypeId"`
}

Metadata Property Metadata

type PartitionInformation

type PartitionInformation struct {
	HighKey              string `json:"HighKey"`
	ID                   string `json:"Id"`
	LowKey               string `json:"LowKey"`
	ServicePartitionKind string `json:"ServicePartitionKind"`
}

PartitionInformation Partition information

type PartitionItem

type PartitionItem struct {
	CurrentConfigurationEpoch ConfigurationEpoch   `json:"CurrentConfigurationEpoch"`
	HealthState               string               `json:"HealthState"`
	MinReplicaSetSize         int64                `json:"MinReplicaSetSize"`
	PartitionInformation      PartitionInformation `json:"PartitionInformation"`
	PartitionStatus           string               `json:"PartitionStatus"`
	ServiceKind               string               `json:"ServiceKind"`
	TargetReplicaSetSize      int64                `json:"TargetReplicaSetSize"`
}

PartitionItem encapsulates the service information returned for each PartitionItem under the service

type PartitionItemsPage

type PartitionItemsPage struct {
	ContinuationToken *string         `json:"ContinuationToken"`
	Items             []PartitionItem `json:"Items"`
}

PartitionItemsPage encapsulates the paged response model for PartitionItems in the Service Fabric API

type PropValue

type PropValue struct {
	Data string `json:"Data"`
	Kind string `json:"Kind"`
}

PropValue Property value

type PropertiesListPage

type PropertiesListPage struct {
	ContinuationToken string     `json:"ContinuationToken"`
	IsConsistent      bool       `json:"IsConsistent"`
	Properties        []Property `json:"Properties"`
}

PropertiesListPage encapsulates the response model for PagedPropertyInfoList in the Service Fabric API

type Property

type Property struct {
	Metadata Metadata  `json:"Metadata"`
	Name     string    `json:"Name"`
	Value    PropValue `json:"Value"`
}

Property Paged Property Info

type ReplicaItem

type ReplicaItem struct {
	*ReplicaItemBase
	ID string `json:"ReplicaId"`
}

ReplicaItem holds replica specific data

func (*ReplicaItem) GetReplicaData

func (m *ReplicaItem) GetReplicaData() (string, *ReplicaItemBase)

GetReplicaData returns replica data

type ReplicaItemBase

type ReplicaItemBase struct {
	Address                      string `json:"Address"`
	HealthState                  string `json:"HealthState"`
	LastInBuildDurationInSeconds string `json:"LastInBuildDurationInSeconds"`
	NodeName                     string `json:"NodeName"`
	ReplicaRole                  string `json:"ReplicaRole"`
	ReplicaStatus                string `json:"ReplicaStatus"`
	ServiceKind                  string `json:"ServiceKind"`
}

ReplicaItemBase shared data used in both replicas and instances

type ReplicaItemsPage

type ReplicaItemsPage struct {
	ContinuationToken *string       `json:"ContinuationToken"`
	Items             []ReplicaItem `json:"Items"`
}

ReplicaItemsPage encapsulates the response model for Replicas in the Service Fabric API

type ServiceExtensionLabels

type ServiceExtensionLabels struct {
	XMLName xml.Name `xml:"Labels"`
	Label   []struct {
		XMLName xml.Name `xml:"Label"`
		Value   string   `xml:",chardata"`
		Key     string   `xml:"Key,attr"`
	}
}

ServiceExtensionLabels provides the structure for deserialising the XML document used to store labels in an Extension

type ServiceFabricClient

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

Client for Service Fabric.

func NewServiceFabricClient

func NewServiceFabricClient(httpClient *requests.HTTPClient, endpoint, apiVersion string) (*ServiceFabricClient, error)

func (ServiceFabricClient) DeleteApplication

func (c ServiceFabricClient) DeleteApplication(applicationId string) error

func (ServiceFabricClient) DeleteComposeDeployment

func (c ServiceFabricClient) DeleteComposeDeployment(deploymentName string) error

func (ServiceFabricClient) DeleteService

func (c ServiceFabricClient) DeleteService(serviceId string) error

func (ServiceFabricClient) GetApplication

func (c ServiceFabricClient) GetApplication(appName string) (*ApplicationItem, error)

func (ServiceFabricClient) GetApplications

func (c ServiceFabricClient) GetApplications() (*ApplicationItemsPage, error)

func (ServiceFabricClient) GetClusterHealth

func (c ServiceFabricClient) GetClusterHealth() (bool, error)

func (ServiceFabricClient) GetClusterManifest

func (c ServiceFabricClient) GetClusterManifest() (m ClusterManifest, err error)

func (ServiceFabricClient) GetDeployment

func (c ServiceFabricClient) GetDeployment(deploymentName string) (interface{}, error)

func (ServiceFabricClient) GetProperties

func (c ServiceFabricClient) GetProperties(name string) (bool, map[string]string, error)

func (ServiceFabricClient) GetServiceExtension

func (c ServiceFabricClient) GetServiceExtension(appType, applicationVersion, serviceTypeName, extensionKey string, response interface{}) error

func (ServiceFabricClient) GetServiceExtensionMap

func (c ServiceFabricClient) GetServiceExtensionMap(service *ServiceItem, app *ApplicationItem, extensionKey string) (map[string]string, error)

func (ServiceFabricClient) GetServices

func (c ServiceFabricClient) GetServices(appName string) (*ServiceItemsPage, error)

type ServiceItem

type ServiceItem struct {
	HasPersistedState bool   `json:"HasPersistedState"`
	HealthState       string `json:"HealthState"`
	ID                string `json:"Id"`
	IsServiceGroup    bool   `json:"IsServiceGroup"`
	ManifestVersion   string `json:"ManifestVersion"`
	Name              string `json:"Name"`
	ServiceKind       string `json:"ServiceKind"`
	ServiceStatus     string `json:"ServiceStatus"`
	TypeName          string `json:"TypeName"`
}

ServiceItem encapsulates the embedded model for ServiceItems within the ServiceItemsPage model

type ServiceItemsPage

type ServiceItemsPage struct {
	ContinuationToken *string       `json:"ContinuationToken"`
	Items             []ServiceItem `json:"Items"`
}

ServiceItemsPage encapsulates the paged response model for Services in the Service Fabric API

type ServiceType

type ServiceType struct {
	ServiceTypeDescription ServiceTypeDescription `json:"ServiceTypeDescription"`
	ServiceManifestVersion string                 `json:"ServiceManifestVersion"`
	ServiceManifestName    string                 `json:"ServiceManifestName"`
	IsServiceGroup         bool                   `json:"IsServiceGroup"`
}

ServiceType encapsulates the response model for Service types in the Service Fabric API

type ServiceTypeDescription

type ServiceTypeDescription struct {
	IsStateful               bool           `json:"IsStateful"`
	ServiceTypeName          string         `json:"ServiceTypeName"`
	PlacementConstraints     string         `json:"PlacementConstraints"`
	HasPersistedState        bool           `json:"HasPersistedState"`
	Kind                     string         `json:"Kind"`
	Extensions               []KeyValuePair `json:"Extensions"`
	LoadMetrics              []interface{}  `json:"LoadMetrics"`
	ServicePlacementPolicies []interface{}  `json:"ServicePlacementPolicies"`
}

ServiceTypeDescription Service Type Description

Jump to

Keyboard shortcuts

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