Documentation
¶
Overview ¶
Package ai provides support the HSDP AI services
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Close()
- func (c *Client) Do(req *http.Request, v interface{}) (*Response, error)
- func (c *Client) GetBaseURL() string
- func (c *Client) GetEndpointURL() string
- func (c *Client) NewAIRequest(method, requestPath string, opt interface{}, options ...OptionFunc) (*http.Request, error)
- func (c *Client) SetBaseURL(urlStr string) error
- func (c *Client) SetEndpointURL(urlStr string) error
- type ComputeEnvironment
- type ComputeEnvironmentService
- func (s *ComputeEnvironmentService) CreateComputeEnvironment(env ComputeEnvironment) (*ComputeEnvironment, *Response, error)
- func (s *ComputeEnvironmentService) DeleteComputeEnvironment(env ComputeEnvironment) (*Response, error)
- func (s *ComputeEnvironmentService) GetComputeEnvironmentByID(id string) (*ComputeEnvironment, *Response, error)
- func (s *ComputeEnvironmentService) GetComputeEnvironments(opt *GetOptions, options ...OptionFunc) ([]ComputeEnvironment, *Response, error)
- type ComputeProviderService
- type ComputeTarget
- type ComputeTargetService
- func (s *ComputeTargetService) CreateComputeTarget(target ComputeTarget) (*ComputeTarget, *Response, error)
- func (s *ComputeTargetService) DeleteComputeTarget(target ComputeTarget) (*Response, error)
- func (s *ComputeTargetService) GetComputeTargetByID(id string) (*ComputeTarget, *Response, error)
- func (s *ComputeTargetService) GetComputeTargets(opt *GetOptions, options ...OptionFunc) ([]ComputeTarget, *Response, error)
- type Config
- type EnvironmentVariable
- type GetOptions
- type InputEntry
- type Job
- type JobService
- func (s *JobService) CreateJob(job Job) (*Job, *Response, error)
- func (s *JobService) DeleteJob(job Job) (*Response, error)
- func (s *JobService) GetJobByID(id string) (*Job, *Response, error)
- func (s *JobService) GetJobs(opt *GetOptions, options ...OptionFunc) ([]Job, *Response, error)
- func (s *JobService) TerminateJob(job Job) (*Response, error)
- type OptionFunc
- type OutputEntry
- type ReferenceComputeEnvironment
- type ReferenceComputeModel
- type ReferenceComputeTarget
- type Response
- type SourceCode
- type UpdateRequest
Constants ¶
const (
APIVersion = "1"
)
Variables ¶
var ( ErrBaseURLCannotBeEmpty = errors.New("base URL cannot be empty") ErrEmptyResult = errors.New("empty result") ErrInvalidEndpointURL = errors.New("invalid endpoint URL") )
Errors
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// HTTP Client used to communicate with IAM API
*iam.Client
// User agent used when communicating with the HSDP Notification API
UserAgent string
ComputeTarget *ComputeTargetService
ComputeProvider *ComputeProviderService
// contains filtered or unexported fields
}
A Client manages communication with HSDP AI APIs
func (*Client) Do ¶
Do executes a http request. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.
func (*Client) GetBaseURL ¶ added in v0.44.0
GetBaseURL returns the base URL as configured
func (*Client) GetEndpointURL ¶
GetEndpointURL returns the FHIR Store Endpoint URL as configured
func (*Client) NewAIRequest ¶
func (*Client) SetBaseURL ¶ added in v0.44.0
SetBaseURL sets the base URL for API requests
func (*Client) SetEndpointURL ¶
SetEndpointURL sets the endpoint URL for API requests to a custom endpoint. urlStr should always be specified with a trailing slash.
type ComputeEnvironment ¶
type ComputeEnvironment struct {
ID string `json:"id,omitempty"`
ResourceType string `json:"resourceType" Validate:"required"`
Name string `json:"name" Validate:"required"`
Description string `json:"description"`
Image string `json:"image" Validate:"required"`
IsFactory bool `json:"isFactory,omitempty"`
Created string `json:"created,omitempty"`
CreatedBy string `json:"createdBy,omitempty"`
}
type ComputeEnvironmentService ¶
func (*ComputeEnvironmentService) CreateComputeEnvironment ¶
func (s *ComputeEnvironmentService) CreateComputeEnvironment(env ComputeEnvironment) (*ComputeEnvironment, *Response, error)
func (*ComputeEnvironmentService) DeleteComputeEnvironment ¶
func (s *ComputeEnvironmentService) DeleteComputeEnvironment(env ComputeEnvironment) (*Response, error)
func (*ComputeEnvironmentService) GetComputeEnvironmentByID ¶
func (s *ComputeEnvironmentService) GetComputeEnvironmentByID(id string) (*ComputeEnvironment, *Response, error)
func (*ComputeEnvironmentService) GetComputeEnvironments ¶
func (s *ComputeEnvironmentService) GetComputeEnvironments(opt *GetOptions, options ...OptionFunc) ([]ComputeEnvironment, *Response, error)
type ComputeProviderService ¶
type ComputeProviderService struct {
// contains filtered or unexported fields
}
func (*ComputeProviderService) UpdateProvider ¶
func (s *ComputeProviderService) UpdateProvider(request UpdateRequest) (bool, *Response, error)
type ComputeTarget ¶
type ComputeTarget struct {
ID string `json:"id,omitempty"`
ResourceType string `json:"resourceType" Validate:"required"`
Name string `json:"name" Validate:"required"`
Description string `json:"description"`
InstanceType string `json:"instanceType" Validate:"required"`
Storage int `json:"storage,omitempty"`
IsFactory bool `json:"isFactory,omitempty"`
Created string `json:"created,omitempty"`
CreatedBy string `json:"createdBy,omitempty"`
}
type ComputeTargetService ¶
type ComputeTargetService struct {
// contains filtered or unexported fields
}
func (*ComputeTargetService) CreateComputeTarget ¶
func (s *ComputeTargetService) CreateComputeTarget(target ComputeTarget) (*ComputeTarget, *Response, error)
func (*ComputeTargetService) DeleteComputeTarget ¶
func (s *ComputeTargetService) DeleteComputeTarget(target ComputeTarget) (*Response, error)
func (*ComputeTargetService) GetComputeTargetByID ¶
func (s *ComputeTargetService) GetComputeTargetByID(id string) (*ComputeTarget, *Response, error)
func (*ComputeTargetService) GetComputeTargets ¶
func (s *ComputeTargetService) GetComputeTargets(opt *GetOptions, options ...OptionFunc) ([]ComputeTarget, *Response, error)
type Config ¶
type Config struct {
Region string
Environment string
OrganizationID string `Validate:"required"`
BaseURL string
Service string `Validate:"required"`
DebugLog io.Writer
Retry int
}
Config contains the configuration of a Client
type EnvironmentVariable ¶
type GetOptions ¶
type GetOptions struct {
Page *string `url:"_page,omitempty"`
Count *string `url:"_count,omitempty"`
Sort *string `url:"_sort,omitempty"`
}
GetOptions describes the fields on which you can search for producers
type InputEntry ¶
type Job ¶
type Job struct {
ID string `json:"id,omitempty"`
ResourceType string `json:"resourceType"`
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type"`
Model ReferenceComputeModel `json:"model"`
ComputeTarget ReferenceComputeTarget `json:"computeTarget"`
Input []InputEntry `json:"input"`
Output []OutputEntry `json:"output"`
EnvVars []EnvironmentVariable `json:"envVars"`
CommandArgs []string `json:"commandArgs"`
Status string `json:"status,omitempty"`
StatusMessage string `json:"statusMessage,omitempty"`
Labels []string `json:"labels,omitempty"`
CreatedBy string `json:"createdBy,omitempty"`
Created string `json:"created,omitempty"`
Completed string `json:"completed,omitempty"`
Duration int `json:"duration,omitempty"`
Timeout int `json:"timeOut,omitempty"`
AdditionalConfiguration string `json:"additionalConfiguration,omitempty"`
}
type JobService ¶
type JobService struct {
Client *Client
Path string `Validate:"required"`
Validate *validator.Validate
}
func (*JobService) GetJobByID ¶
func (s *JobService) GetJobByID(id string) (*Job, *Response, error)
func (*JobService) GetJobs ¶
func (s *JobService) GetJobs(opt *GetOptions, options ...OptionFunc) ([]Job, *Response, error)
func (*JobService) TerminateJob ¶
func (s *JobService) TerminateJob(job Job) (*Response, error)
type OptionFunc ¶
OptionFunc is the function signature function for options
type OutputEntry ¶
type ReferenceComputeModel ¶
type ReferenceComputeTarget ¶
type Response ¶
Response is a HSDP IAM API response. This wraps the standard http.Response returned from HSDP IAM and provides convenient access to things like errors