spi

package
v0.0.0-...-9adacb4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2015 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//note: you must set your /etc/hosts for this entry
	API_HOST = "spi.deterlab.net"

	API_PORT = "52323"

	API_HTTPS = "https://" + API_HOST + ":" + API_PORT + "/axis2/services"
)
View Source
const PROJECTS_HTTPS = API_HTTPS + "/Projects"
View Source
const REX_HTTPS = API_HTTPS + "/Realizations"
View Source
const USERS_HTTPS = API_HTTPS + "/Users"
View Source
const XPS_HTTPS = API_HTTPS + "/Experiments"

Variables

View Source
var Debug = false

Functions

func Login

func Login(user, password string) ([]byte, error)

func SetCertificate

func SetCertificate(comboCert []byte) error

setCertificate sets the certificate that is used when communicating with the SPI server

Types

type AccessMember

type AccessMember struct {
	XMLName     xml.Name `xml:"acl"`
	CircleId    string   `xml:"circleId"`
	Permissions []string `xml:"permissions"`
}

type Attribute

type Attribute interface {
	GetName() string
}

type Body

type Body struct {
	XMLName xml.Name `xml:"http://www.w3.org/2003/05/soap-envelope Body"`
}

type Capacity

type Capacity struct {
	Rate float64 `xml:"rate"`
	Kind Kind    `xml:"kind"`
}

type ChallengeResponseEnvelope

type ChallengeResponseEnvelope struct {
	Envelope
	Body struct {
		Body
		ChallengeResponse struct {
			XMLName      xml.Name `xml:"http://api.testbed.deterlab.net/xsd challengeResponse"`
			ResponseData string   `xml:"http://api.testbed.deterlab.net/xsd responseData"`
			ChallengeID  int64    `xml:"http://api.testbed.deterlab.net/xsd challengeID"`
		}
	}
}

type ChallengeResponseResponse

type ChallengeResponseResponse struct {
	Return string `xml:"http://api.testbed.deterlab.net/xsd return"`
}

func ChallengeResponse

func ChallengeResponse(challengeID int64, password string) (
	*ChallengeResponseResponse, error)

ChallengeResponse returns the SPI's response to a challenge with the certificate decoded. The provided challengeID must be the result fo a RequestChallenge call and the password is just a plain-text standard encoded string.

type ChallengeResponseResponseEnvelope

type ChallengeResponseResponseEnvelope struct {
	Envelope
	Body struct {
		Body
		ChallengeResponseResponse ChallengeResponseResponse `xml:"http://api.testbed.deterlab.net/xsd challengeResponseResponse"`
	}
}

type ChangeAttribute

type ChangeAttribute struct {
	XMLName xml.Name `xml:"changes"`
	Delete  bool     `xml:"delete"`
	Name    string   `xml:"name"`
	Value   string   `xml:"value"`
}

type ChangeExperimentACLEnvelope

type ChangeExperimentACLEnvelope struct {
	Envelope
	Body struct {
		Body
		ChangeExperimentACL struct {
			XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd changeExperimentACL"`
			EID     string   `xml:"eid"`
			ACL     []AccessMember
		}
	}
}

type ChangeExperimentACLResponse

type ChangeExperimentACLResponse struct {
	Return []ChangeResult `xml:"return"`
}

func ChangeExperimentACL

func ChangeExperimentACL(name string, acl []AccessMember) (
	*ChangeExperimentACLResponse, error)

type ChangeExperimentACLResponseEnvelope

type ChangeExperimentACLResponseEnvelope struct {
	Envelope
	Body struct {
		Body
		ChangeExperimentACLResponse ChangeExperimentACLResponse
	}
}

type ChangeExperimentProfileEnvelope

type ChangeExperimentProfileEnvelope struct {
	Envelope
	Body struct {
		Body
		ChangeExperimentProfile struct {
			XMLName xml.Name          `xml:"http://api.testbed.deterlab.net/xsd changeExperimentProfile"`
			EID     string            `xml:"eid"`
			Changes []ChangeAttribute `xml:"changes"`
		}
	}
}

type ChangeExperimentProfileResponse

type ChangeExperimentProfileResponse struct {
	Return []ChangeResult `xml:"return"`
}

func ChangeExperimentProfile

func ChangeExperimentProfile(name string, attributes []ChangeAttribute) (
	*ChangeExperimentProfileResponse, error)

type ChangeExperimentProfileResponseEnvelope

type ChangeExperimentProfileResponseEnvelope struct {
	Envelope
	Body struct {
		Body
		ChangeExperimentProfileResponse ChangeExperimentProfileResponse
	}
}

type ChangeResult

type ChangeResult struct {
	Name    string `xml:"name"`
	Reason  string `xml:"reason"`
	Success bool   `xml:"success"`
}

type Computer

type Computer struct {
	XMLName    xml.Name    `xml:"computer"`
	Name       string      `xml:"name"`
	Interfaces []Interface //`xml:"interfaces"`
	OSs        []OS        //`xml:"os"`
	Attributes []TopDLAttribute
}

type CreateExperimentEnvelope

type CreateExperimentEnvelope struct {
	Envelope
	Body struct {
		Body
		CreateExperiment struct {
			XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd createExperiment"`
			EID     string   `xml:"eid"`
			Owner   string   `xml:"owner"`
			Aspects []ExperimentAspect
			Profile []Attribute
		}
	}
}

type CreateExperimentResponse

type CreateExperimentResponse struct {
	Return bool `xml:"return"`
}

func CreateExperiment

func CreateExperiment(expId, owner, topdl string, virtualized bool) (
	*CreateExperimentResponse, error)

type CreateExperimentResponseEnvelope

type CreateExperimentResponseEnvelope struct {
	Envelope
	Body struct {
		Body
		CreateExperimentResponse CreateExperimentResponse `xml:"createExperimentResponse"`
	}
}

type DescriptionAttr

type DescriptionAttr struct {
	XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd profile"`
	Name    string   `xml:"name"`
	Value   string   `xml:"value"`
}

func (DescriptionAttr) GetName

func (d DescriptionAttr) GetName() string

type Element

type Element interface{}

type Elements

type Elements struct {
	XMLName  xml.Name  `xml:"elements"`
	Elements []Element `xml:"element"`
}

type Envelope

type Envelope struct {
	XMLName xml.Name `xml:"http://www.w3.org/2003/05/soap-envelope Envelope"`
	Body    Body
}

Common messaging structs -----------------------------------------------------

type Experiment

type Experiment struct {
	XMLName    xml.Name    `xml:"experiment"`
	Substrates []Substrate `xml:"substrates"`
	Elements   Elements    `xml:"elements"`
}

type ExperimentAspect

type ExperimentAspect struct {
	XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd aspects"`
	Data    string   `xml:"data"`
	Type    string   `xml:"type"`
}

type ExperimentDescription

type ExperimentDescription struct {
	XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd return"`
	Name    string   `xml:"experimentId"`
	Owner   string   `xml:"owner"`
	Staus   string   `xml:"status"`
	Perms   []string `xml:"perms"`
}

type ExperimentFaultEnvelope

type ExperimentFaultEnvelope struct {
	Envelope
	Body struct {
		Body
		Fault struct {
			Code struct {
				Value string
			}
			Reason struct {
				Text string
			}
			Detail struct {
				ExperimentsDeterFault struct {
					//XMLName    xml.Name `xml:"http://api.testbed.deterlab.net/xsd ExperimentsDeterFault"`
					DeterFault struct {
						//XMLName       xml.Name `xml:"http://api.testbed.deterlab.net/xsd DeterFault"`
						DetailMessage string `xml:"detailMessage"`
						ErrorCode     int    `xml:"errorCode"`
						ErrorMessage  string `xml:"errorMessage"`
					}
				}
			}
		}
	}
}

func (ExperimentFaultEnvelope) String

func (f ExperimentFaultEnvelope) String() string

type Interface

type Interface struct {
	XMLName   xml.Name `xml:"interface"`
	Name      string   `xml:"name"`
	Substrate string   `xml:"substrate"`
	Capacity  Capacity `xml:"capacity"`
	Latency   Latency  `xml:"latency"`
}

type Kind

type Kind struct {
	//should be either "max" or "average"
	Value string `xml:"value"`
}

type Latency

type Latency struct {
	Time float64 `xml:"time"`
	Kind Kind    `xml:"kind"`
}

type Member

type Member struct {
	Permissions string `xml:"http://api.testbed.deterlab.net/xsd permissions"`
	// contains filtered or unexported fields
}

type OS

type OS struct {
	XMLName xml.Name `xml:"os"`
	Name    string   `xml:"name"`
	Version string   `xml:"version"`
}

type ProjectDescription

type ProjectDescription struct {
	Approved  bool   `xml:"http://api.testbed.deterlab.net/xsd approved"`
	Members   Member `xml:"http://api.testbed.deterlab.net/xsd members"`
	Owner     string `xml:"http://api.testbed.deterlab.net/xsd owner"`
	ProjectId string `xml:"http://api.testbed.deterlab.net/xsd projectId"`
}

type RealizationContainment

type RealizationContainment struct {
	XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd containment"`
	Inner   string   `xml:"inner"`
	Outer   string   `xml:"outer"`
}

type RealizationDescription

type RealizationDescription struct {
	XMLName     xml.Name                 `xml:"http://api.testbed.deterlab.net/xsd return"`
	Circle      string                   `xml:"circle"`
	Experiment  string                   `xml:"experiment"`
	Name        string                   `xml:"name"`
	Status      string                   `xml:"status"`
	Containment []RealizationContainment `xml:"containment"`
	Mapping     []RealizationMap         `xml:"mapping"`
	Perms       []string                 `xml:"perms"`
}

type RealizationMap

type RealizationMap struct {
	XMLName      xml.Name `xml:"http://api.testbed.deterlab.net/xsd mapping"`
	Resource     string   `xml:"resource"`
	TopologyName string   `xml:"topologyName"`
}

type RealizationsFaultEnvelope

type RealizationsFaultEnvelope struct {
	Envelope
	Body struct {
		Body
		Fault struct {
			Code struct {
				Value string
			}
			Reason struct {
				Text string
			}
			Detail struct {
				RealizationsDeterFault struct {
					//XMLName    xml.Name `xml:"http://api.testbed.deterlab.net/xsd ExperimentsDeterFault"`
					DeterFault struct {
						//XMLName       xml.Name `xml:"http://api.testbed.deterlab.net/xsd DeterFault"`
						DetailMessage string `xml:"detailMessage"`
						ErrorCode     int    `xml:"errorCode"`
						ErrorMessage  string `xml:"errorMessage"`
					}
				}
			}
		}
	}
}

func (RealizationsFaultEnvelope) String

func (f RealizationsFaultEnvelope) String() string

type RealizeExperimentEnvelope

type RealizeExperimentEnvelope struct {
	Envelope
	Body struct {
		Body
		RealizeExperiment struct {
			XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd realizeExperiment"`
			UID     string   `xml:"uid"`
			EID     string   `xml:"eid"`
			CID     string   `xml:"cid"`
		}
	}
}

type RealizeExperimentResponse

type RealizeExperimentResponse struct {
	Return RealizationDescription `xml:"return"`
}

func RealizeExperiment

func RealizeExperiment(expId, circle, owner string) (
	*RealizeExperimentResponse, error)

type RealizeExperimentResponseEnvelope

type RealizeExperimentResponseEnvelope struct {
	Envelope
	Body struct {
		Body
		RealizeExperimentResponse RealizeExperimentResponse `xml:"realizeExperimentResponse"`
	}
}

type ReleaseRealizationEnvelope

type ReleaseRealizationEnvelope struct {
	Envelope
	Body struct {
		Body
		ReleaseRealization struct {
			XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd releaseRealization"`
			Name    string   `xml:"name"`
		}
	}
}

type ReleaseRealizationResponse

type ReleaseRealizationResponse struct {
	Return bool `xml:"return"`
}

func ReleaseRealization

func ReleaseRealization(expId string) (*ReleaseRealizationResponse, error)

type ReleaseRealizationResponseEnvelope

type ReleaseRealizationResponseEnvelope struct {
	Envelope
	Body struct {
		Body
		ReleaseRealizationResponse ReleaseRealizationResponse `xml:"releaseRealizationResponse"`
	}
}

type RemoveExperimentEnvelope

type RemoveExperimentEnvelope struct {
	Envelope
	Body struct {
		Body
		RemoveExperiment struct {
			XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd removeExperiment"`
			EID     string   `xml:"eid"`
		}
	}
}

type RemoveExperimentResponse

type RemoveExperimentResponse struct {
	XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd removeExperimentResponse"`
	Return  bool     `xml:"return"`
}

func RemoveExperiment

func RemoveExperiment(expId string) (*RemoveExperimentResponse, error)

type RemoveExperimentResponseEnvelope

type RemoveExperimentResponseEnvelope struct {
	Envelope
	Body struct {
		Body
		RemoveExperimentResponse RemoveExperimentResponse
	}
}

type RemoveRealizationEnvelope

type RemoveRealizationEnvelope struct {
	Envelope
	Body struct {
		Body
		RemoveRealization struct {
			XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd removeRealization"`
			Name    string   `xml:"name"`
		}
	}
}

type RemoveRealizationResponse

type RemoveRealizationResponse struct {
	Return bool `xml:"return"`
}

func RemoveRealization

func RemoveRealization(expId string) (*RemoveRealizationResponse, error)

type RemoveRealizationResponseEnvelope

type RemoveRealizationResponseEnvelope struct {
	Envelope
	Body struct {
		Body
		RemoveRealizationResponse RemoveRealizationResponse `xml:"removeRealizationResponse"`
	}
}

type RequestChallengeEnvelope

type RequestChallengeEnvelope struct {
	Envelope
	Body struct {
		Body
		RequestChallenge struct {
			XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd requestChallenge"`
			UID     string   `xml:"uid"`
		}
	}
}

type RequestChallengeResponse

type RequestChallengeResponse struct {
	ChallengeID int64  `xml:"http://api.testbed.deterlab.net/xsd challengeID"`
	Validity    string `xml:"http://api.testbed.deterlab.net/xsd validity"`
	Type        string `xml:"http://api.testbed.deterlab.net/xsd type"`
}

func RequestChallenge

func RequestChallenge(uid string) (*RequestChallengeResponse, error)

RequestChallenge returns the SPI's response to a challenge given a user-id.

type RequestChallengeResponseEnvelope

type RequestChallengeResponseEnvelope struct {
	Envelope
	Body struct {
		Body
		RequestChallengeResponse struct {
			XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd requestChallengeResponse"`
			Return  struct {
				XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd return"`
				RequestChallengeResponse
			}
		}
	}
}

type Substrate

type Substrate struct {
	Name     string   `xml:"name"`
	Capacity Capacity `xml:"capacity"`
	Latency  Latency  `xml:"latency"`
}

type TopDLAttribute

type TopDLAttribute struct {
	XMLName   xml.Name `xml:"attribute"`
	Attribute string   `xml:"attribute"`
	Value     string   `xml:"value"`
}

type ViewExperimentsEnvelope

type ViewExperimentsEnvelope struct {
	Envelope
	Body struct {
		Body
		ViewExperiments struct {
			XMLName  xml.Name `xml:"http://api.testbed.deterlab.net/xsd viewExperiments"`
			UID      string   `xml:"uid"`
			Regex    string   `xml:"regex"`
			ListOnly bool     `xml:"listOnly"`
			Offset   int      `xml:"offset"`
			Count    int      `xml:"count"`
		}
	}
}

type ViewExperimentsResponse

type ViewExperimentsResponse struct {
	Return []ExperimentDescription `xml:"return"`
}

func ViewExperiments

func ViewExperiments(user, regex string, listOnly bool) (*ViewExperimentsResponse, error)

type ViewExperimentsResponseEnvelope

type ViewExperimentsResponseEnvelope struct {
	Envelope
	Body struct {
		Body
		ViewExperimentsResponse ViewExperimentsResponse `xml:"viewExperimentsResponse"`
	}
}

type ViewProjectsEnvelope

type ViewProjectsEnvelope struct {
	Envelope
	Body struct {
		Body
		ViewProjects struct {
			XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd viewProjects"`
			UID     string   `xml:"uid"`
			Regex   string   `xml:"regex"`
		}
	}
}

type ViewProjectsResponse

type ViewProjectsResponse struct {
	Return []ProjectDescription `xml:"http://api.testbed.deterlab.net/xsd return"`
}

func ViewProjects

func ViewProjects(uid string, regex string) (*ViewProjectsResponse, error)

type ViewProjectsResponseEnvelope

type ViewProjectsResponseEnvelope struct {
	Envelope
	Body struct {
		Body
		ViewProjectsResponse ViewProjectsResponse `xml:"http://api.testbed.deterlab.net/xsd viewProjectsResponse"`
	}
}

type ViewRealizationsEnvelope

type ViewRealizationsEnvelope struct {
	Envelope
	Body struct {
		Body
		ViewRealizations struct {
			XMLName xml.Name `xml:"http://api.testbed.deterlab.net/xsd viewRealizations"`
			UID     string   `xml:"uid"`
			Regex   string   `xml:"regex"`
		}
	}
}

type ViewRealizationsResponse

type ViewRealizationsResponse struct {
	Return []RealizationDescription `xml:"return"`
}

func ViewRealizations

func ViewRealizations(user, regex string) (*ViewRealizationsResponse, error)

type ViewRealizationsResponseEnvelope

type ViewRealizationsResponseEnvelope struct {
	Envelope
	Body struct {
		Body
		ViewRealizationsResponse ViewRealizationsResponse `xml:"viewRealizationsResponse"`
	}
}

Jump to

Keyboard shortcuts

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