Documentation
¶
Index ¶
- Variables
- func SetDefaultClient(client *Client)
- type AuthCodeTokenProvider
- type BatchContext
- type BatchContextsResponse
- type BatchFile
- type BatchFileResponse
- type BatchFileSet
- type BatchFileSetsResponse
- type BatchJob
- type BatchJobInputRequest
- type BatchJobOutput
- type BatchJobsResponse
- type BatchServer
- type BatchServersResponse
- type CASLib
- type CASLibsResponse
- type CASServer
- type CASServersResponse
- type CASTable
- type CASTableColumn
- type CASTableColumnsResponse
- type CASTableRowsResponse
- type CASTablesResponse
- type Client
- func (c *Client) CancelBatchJob(ctx context.Context, jobId string) (err error)
- func (c *Client) CancelComputeJob(ctx context.Context, sessionId string, jobId string, ifMatch string) (state string, err error)
- func (c *Client) CancelComputeSession(ctx context.Context, sessionId string, ifMatch string) (state string, err error)
- func (c *Client) CancelJobExecutionJob(ctx context.Context, jobID string) (err error)
- func (c *Client) CreateBatchFileSet(ctx context.Context, contextId string) (resp BatchFileSet, err error)
- func (c *Client) CreateBatchJob(ctx context.Context, req SubmitBatchJobRequest) (resp BatchJob, err error)
- func (c *Client) CreateComputeJob(ctx context.Context, sessionId string, req CreateComputeJobRequest) (resp ComputeJob, err error)
- func (c *Client) CreateComputeSession(ctx context.Context, contextId string, req CreateComputeSessionRequest) (resp ComputeSession, err error)
- func (c *Client) DeleteBatchFileSet(ctx context.Context, fileSetId string) (err error)
- func (c *Client) DeleteBatchJob(ctx context.Context, jobId string) (err error)
- func (c *Client) DeleteBatchServer(ctx context.Context, serverId string) (err error)
- func (c *Client) DeleteComputeJob(ctx context.Context, sessionId string, jobId string) (err error)
- func (c *Client) DeleteComputeSession(ctx context.Context, sessionId string) (err error)
- func (c *Client) DownloadBatchFile(ctx context.Context, fileSetId string, fileName string) (content []byte, err error)
- func (c *Client) DownloadFile(ctx context.Context, fileID string) (content []byte, err error)
- func (c *Client) GetBatchContextByName(ctx context.Context, name string) (resp BatchContext, err error)
- func (c *Client) GetBatchContexts(ctx context.Context) (resp BatchContextsResponse, err error)
- func (c *Client) GetBatchFile(ctx context.Context, fileSetId string) (resp BatchFileResponse, err error)
- func (c *Client) GetBatchFileInfo(ctx context.Context, fileSetId string, fileName string) (resp BatchFile, err error)
- func (c *Client) GetBatchFileSetsInfo(ctx context.Context, id string) (resp BatchFileSet, err error)
- func (c *Client) GetBatchFileSetsList(ctx context.Context) (resp BatchFileSetsResponse, err error)
- func (c *Client) GetBatchJobInfo(ctx context.Context, jobId string) (resp BatchJob, err error)
- func (c *Client) GetBatchJobOutput(ctx context.Context, jobId string) (resp BatchJobOutput, err error)
- func (c *Client) GetBatchJobState(ctx context.Context, jobId string) (state string, err error)
- func (c *Client) GetBatchJobsList(ctx context.Context) (resp BatchJobsResponse, err error)
- func (c *Client) GetBatchServerInfo(ctx context.Context, serverId string) (resp BatchServer, err error)
- func (c *Client) GetBatchServersList(ctx context.Context) (resp BatchServersResponse, err error)
- func (c *Client) GetCASLibs(ctx context.Context, serverID string, opts ListOptions) (resp CASLibsResponse, err error)
- func (c *Client) GetCASServers(ctx context.Context, opts ListOptions) (resp CASServersResponse, err error)
- func (c *Client) GetCASTableColumns(ctx context.Context, serverID string, caslibName string, tableName string, ...) (resp CASTableColumnsResponse, err error)
- func (c *Client) GetCASTableDataColumns(ctx context.Context, serverID string, caslibName string, tableName string, ...) (resp CASTableColumnsResponse, err error)
- func (c *Client) GetCASTableInfo(ctx context.Context, serverID string, caslibName string, tableName string) (resp CASTable, err error)
- func (c *Client) GetCASTableRows(ctx context.Context, serverID string, caslibName string, tableName string, ...) (resp CASTableRowsResponse, err error)
- func (c *Client) GetCASTables(ctx context.Context, serverID string, caslibName string, opts ListOptions) (resp CASTablesResponse, err error)
- func (c *Client) GetComputeContextInfo(ctx context.Context, contextId string) (resp ComputeContext, err error)
- func (c *Client) GetComputeContexts(ctx context.Context) (resp ComputeContextsResponse, err error)
- func (c *Client) GetComputeJobInfo(ctx context.Context, sessionId string, jobId string) (resp ComputeJob, err error)
- func (c *Client) GetComputeJobListing(ctx context.Context, sessionId string, jobId string) (resp ComputeLogLinesResponse, err error)
- func (c *Client) GetComputeJobListingText(ctx context.Context, sessionId string, jobId string) (text string, err error)
- func (c *Client) GetComputeJobLog(ctx context.Context, sessionId string, jobId string) (resp ComputeLogLinesResponse, err error)
- func (c *Client) GetComputeJobLogText(ctx context.Context, sessionId string, jobId string) (text string, err error)
- func (c *Client) GetComputeJobState(ctx context.Context, sessionId string, jobId string) (state string, err error)
- func (c *Client) GetComputeJobsList(ctx context.Context, sessionId string) (resp ComputeJobsResponse, err error)
- func (c *Client) GetComputeSessionInfo(ctx context.Context, sessionId string) (resp ComputeSession, err error)
- func (c *Client) GetComputeSessionState(ctx context.Context, sessionId string) (state string, err error)
- func (c *Client) GetComputeSessionsList(ctx context.Context) (resp ComputeSessionsResponse, err error)
- func (c *Client) GetConfiguration(ctx context.Context, definitionName string) (string, error)
- func (c *Client) GetFiles(ctx context.Context, opts FileListOptions) (resp ViyaFilesResponse, err error)
- func (c *Client) GetIdentitiesLDAPUser(ctx context.Context) (map[string]any, error)
- func (c *Client) GetIdentitiesUsers(ctx context.Context) (identitiesUserResp IdentitiesUsersResp, err error)
- func (c *Client) GetJobExecutionJob(ctx context.Context, jobID string) (resp JobExecutionJob, err error)
- func (c *Client) GetJobExecutionJobLog(ctx context.Context, jobID string) (string, error)
- func (c *Client) GetJobExecutionJobs(ctx context.Context, opts ListOptions) (resp JobExecutionJobsResponse, err error)
- func (c *Client) LoadCASTableToMemory(ctx context.Context, serverID string, caslibName string, tableName string, ...) error
- func (c *Client) PatchIdentitiesLDAPGroup(ctx context.Context, updates map[string]any) (bool, error)
- func (c *Client) PromoteCASTable(ctx context.Context, serverID string, caslibName string, tableName string) (resp CASTable, err error)
- func (c *Client) RefreshIdentitiesCache(ctx context.Context) (success bool, err error)
- func (c *Client) SendBatchJobInput(ctx context.Context, jobId string, input []string) (err error)
- func (c *Client) SetComputeJobState(ctx context.Context, sessionId string, jobId string, state string, ...) (newState string, err error)
- func (c *Client) SetComputeSessionState(ctx context.Context, sessionId string, state string, ifMatch string) (newState string, err error)
- func (c *Client) SubmitJobExecutionCode(ctx context.Context, req SubmitJobExecutionCodeRequest) (resp JobExecutionJob, err error)
- func (c *Client) TokenURL() string
- func (c *Client) UnloadCASTableFromMemory(ctx context.Context, serverID string, caslibName string, tableName string) error
- func (c *Client) UpdateIdentitiesLDAPObjectFilter(ctx context.Context, usernames []string) (bool, error)
- func (c *Client) UploadBatchFile(ctx context.Context, fileSetId string, fileName string, content []byte) (err error)
- func (c *Client) UploadBatchFileFromReader(ctx context.Context, fileSetId string, fileName string, r io.Reader) (err error)
- func (c *Client) UploadCSVToCASTable(ctx context.Context, serverID string, caslibName string, tableName string, ...) (resp CASTable, err error)
- func (c *Client) UploadCSVToCASTableFromReader(ctx context.Context, serverID string, caslibName string, tableName string, ...) (resp CASTable, err error)
- func (c *Client) UploadFile(ctx context.Context, fileName string, contentType string, content []byte) (resp ViyaFile, err error)
- func (c *Client) UploadFileFromReader(ctx context.Context, fileName string, contentType string, r io.Reader) (resp ViyaFile, err error)
- func (c *Client) WaitBatchJobCompleted(ctx context.Context, jobId string, interval time.Duration) (jobInfo BatchJob, err error)
- type ClientCredentialsTokenProvider
- type ComputeContext
- type ComputeContextsResponse
- type ComputeEnvironment
- type ComputeExternalResource
- type ComputeJob
- type ComputeJobsResponse
- type ComputeLogLine
- type ComputeLogLinesResponse
- type ComputeOutputStatistics
- type ComputeSession
- type ComputeSessionsResponse
- type ConfigurationsResp
- type CreateComputeJobRequest
- type CreateComputeSessionRequest
- type ErrorResponse
- type FileListOptions
- type IdentitiesUsers
- type IdentitiesUsersResp
- type JobExecutionError
- type JobExecutionJob
- type JobExecutionJobsResponse
- type LauncherOptions
- type Link
- type ListOptions
- type ListResponse
- type Metadata
- type Option
- type PasswordTokenProvider
- type SubmitBatchJobRequest
- type SubmitJobExecutionCodeRequest
- type TokenProvider
- type TokenProviderOption
- type ViyaFile
- type ViyaFilesResponse
Constants ¶
This section is empty.
Variables ¶
var ErrDefaultClientNotSet = errors.New("viya default client is not set")
ErrDefaultClientNotSet is returned when the process-wide default client has not been configured.
var ErrViyaAuthFailed = errors.New("viya authentication failed")
ErrViyaAuthFailed is returned when SAS Viya authentication cannot produce a bearer token.
Functions ¶
func SetDefaultClient ¶
func SetDefaultClient(client *Client)
SetDefaultClient stores the process-wide default client.
Prefer passing *Client explicitly in new code. The default client exists for applications that want package-level wiring around a single SAS Viya deployment. Passing nil clears the default client.
Types ¶
type AuthCodeTokenProvider ¶
type AuthCodeTokenProvider struct {
*ClientCredentialsTokenProvider
// contains filtered or unexported fields
}
AuthCodeTokenProvider provides bearer tokens using the OAuth2 authorization code flow.
type BatchContext ¶
type BatchContext struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
State string `json:"state"`
CreatedBy string `json:"createdBy"`
CreationTimeStamp time.Time `json:"creationTimeStamp"`
IsMultiServer bool `json:"isMultiServer"`
LauncherContextID string `json:"launcherContextId"`
MaxServers int `json:"maxServers"`
MinServers int `json:"minServers"`
ModifiedBy string `json:"modifiedBy"`
ModifiedTimeStamp time.Time `json:"modifiedTimeStamp"`
ProviderOptions string `json:"providerOptions"`
QueueName string `json:"queueName"`
RequiredResources string `json:"requiredResources"`
RunServerAs string `json:"runServerAs"`
SASOptions string `json:"sasOptions"`
ServerTimeout int `json:"serverTimeout"`
Version int `json:"version"`
Links []Link `json:"links"`
}
BatchContext describes a SAS Viya Batch execution context.
A context defines how batch jobs are launched, including queue, resource, server, and SAS option settings.
type BatchContextsResponse ¶
type BatchContextsResponse = ListResponse[BatchContext]
BatchContextsResponse is a collection of SAS Viya Batch contexts.
type BatchFile ¶
type BatchFile struct {
CreationTimeStamp time.Time `json:"creationTimeStamp"`
CreatedBy string `json:"createdBy"`
ModifiedTimeStamp time.Time `json:"modifiedTimeStamp"`
ModifiedBy string `json:"modifiedBy"`
FileSetID string `json:"fileSetId"`
Name string `json:"name"`
Size int64 `json:"size"`
Links []Link `json:"links"`
Version int `json:"version"`
}
BatchFile describes a file stored in a SAS Viya Batch file set.
type BatchFileResponse ¶
type BatchFileResponse = ListResponse[BatchFile]
BatchFileResponse is a collection of SAS Viya Batch files.
type BatchFileSet ¶
type BatchFileSet struct {
ID string `json:"id"`
CreatedBy string `json:"createdBy"`
CreationTimeStamp time.Time `json:"creationTimeStamp"`
ModifiedBy string `json:"modifiedBy"`
ModifiedTimeStamp time.Time `json:"modifiedTimeStamp"`
ContextID string `json:"contextId"`
Version int `json:"version"`
Links []Link `json:"links"`
}
BatchFileSet describes a SAS Viya Batch file set.
File sets group input, output, list, and log files associated with batch jobs.
type BatchFileSetsResponse ¶
type BatchFileSetsResponse = ListResponse[BatchFileSet]
BatchFileSetsResponse is a collection of SAS Viya Batch file sets.
type BatchJob ¶
type BatchJob struct {
ID string `json:"id"`
Name string `json:"name"`
State string `json:"state"`
CreatedBy string `json:"createdBy"`
CreationTimeStamp time.Time `json:"creationTimeStamp"`
StartedTimeStamp time.Time `json:"startedTimeStamp"`
SubmittedTimeStamp time.Time `json:"submittedTimeStamp"`
EndedTimeStamp time.Time `json:"endedTimeStamp"`
ModifiedBy string `json:"modifiedBy"`
ModifiedTimeStamp time.Time `json:"modifiedTimeStamp"`
ContextID string `json:"contextId"`
FileSetID string `json:"fileSetId"`
ExecutionHost string `json:"executionHost"`
LogFile string `json:"logFile"`
ProcessID string `json:"processId"`
WorkloadJobID string `json:"workloadJobId"`
ReturnCode int `json:"returnCode"`
Version int `json:"version"`
Links []Link `json:"links"`
}
BatchJob describes a SAS Viya Batch job and its execution state.
type BatchJobInputRequest ¶ added in v0.3.0
BatchJobInputRequest is the request body for sending STDIN to a running Batch job.
type BatchJobOutput ¶ added in v0.3.0
type BatchJobOutput struct {
Errors []string `json:"errors"`
Output []string `json:"output"`
Version int `json:"version"`
}
BatchJobOutput describes STDOUT and STDERR text retrieved from a running Batch job.
type BatchJobsResponse ¶
type BatchJobsResponse = ListResponse[BatchJob]
BatchJobsResponse is a collection of SAS Viya Batch jobs.
type BatchServer ¶ added in v0.3.0
type BatchServer struct {
ID string `json:"id"`
CreatedBy string `json:"createdBy"`
CreationTimeStamp time.Time `json:"creationTimeStamp"`
ModifiedBy string `json:"modifiedBy"`
ModifiedTimeStamp time.Time `json:"modifiedTimeStamp"`
ContextID string `json:"contextId"`
HostName string `json:"hostName"`
IsPermanent bool `json:"isPermanent"`
ProcessID string `json:"processId"`
QueueName string `json:"queueName"`
RuleID string `json:"ruleId"`
RunServerAs string `json:"runServerAs"`
State string `json:"state"`
Version int `json:"version"`
Links []Link `json:"links"`
}
BatchServer describes a reusable SAS Viya Batch server.
type BatchServersResponse ¶ added in v0.3.0
type BatchServersResponse = ListResponse[BatchServer]
BatchServersResponse is a collection of SAS Viya Batch servers.
type CASLib ¶ added in v0.3.0
type CASLib struct {
Name string `json:"name"`
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
Version int `json:"version,omitempty"`
Links []Link `json:"links,omitempty"`
}
CASLib describes a CAS library returned by the CAS Management API.
type CASLibsResponse ¶ added in v0.3.0
type CASLibsResponse = ListResponse[CASLib]
CASLibsResponse is a collection of SAS Viya CAS libraries.
type CASServer ¶ added in v0.3.0
type CASServer struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Version int `json:"version,omitempty"`
Links []Link `json:"links,omitempty"`
}
CASServer describes a CAS server returned by the CAS Management API.
type CASServersResponse ¶ added in v0.3.0
type CASServersResponse = ListResponse[CASServer]
CASServersResponse is a collection of SAS Viya CAS servers.
type CASTable ¶ added in v0.3.0
type CASTable struct {
Name string `json:"name"`
CaslibName string `json:"caslibName,omitempty"`
RowCount int64 `json:"rowCount,omitempty"`
ColumnCount int `json:"columnCount,omitempty"`
Scope string `json:"scope,omitempty"`
SourceName string `json:"sourceName,omitempty"`
Version int `json:"version,omitempty"`
Links []Link `json:"links,omitempty"`
}
CASTable describes a CAS table returned by the CAS Management API.
type CASTableColumn ¶ added in v0.3.0
type CASTableColumn struct {
Name string `json:"name"`
Type string `json:"type,omitempty"`
RawLength int `json:"rawLength,omitempty"`
Length int `json:"length,omitempty"`
Label string `json:"label,omitempty"`
Format string `json:"format,omitempty"`
Index int `json:"index,omitempty"`
}
CASTableColumn describes a CAS table column.
type CASTableColumnsResponse ¶ added in v0.3.0
type CASTableColumnsResponse = ListResponse[CASTableColumn]
CASTableColumnsResponse is a collection of SAS Viya CAS table columns.
type CASTableRowsResponse ¶ added in v0.3.0
type CASTableRowsResponse struct {
Columns []string `json:"columns"`
Rows []map[string]any `json:"rows"`
Count int `json:"count"`
Start int `json:"start"`
Limit int `json:"limit"`
}
CASTableRowsResponse contains sample rows from a CAS table.
type CASTablesResponse ¶ added in v0.3.0
type CASTablesResponse = ListResponse[CASTable]
CASTablesResponse is a collection of SAS Viya CAS tables.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a small SAS Viya REST API client.
New clients should be constructed with NewClient and a SAS Viya base URL, for example "https://example.viya.sas.com". Authentication can be supplied with WithTokenProvider.
func GetDefaultClient ¶
GetDefaultClient returns the process-wide default client.
It returns ErrDefaultClientNotSet when SetDefaultClient has not been called or when the default client has been cleared.
func MustGetDefaultClient ¶ added in v0.2.0
func MustGetDefaultClient() *Client
MustGetDefaultClient returns the process-wide default client.
It panics with ErrDefaultClientNotSet when SetDefaultClient has not been called or when the default client has been cleared.
func NewClient ¶
NewClient creates a SAS Viya REST client bound to baseURL.
The baseURL should be the root of a SAS Viya deployment, without a trailing service path. See the SAS Viya REST API usage notes: https://developer.sas.com/docs/rest-apis/getting-started/authentication
func (*Client) CancelBatchJob ¶ added in v0.3.0
CancelBatchJob requests cancellation of a SAS Viya Batch job.
func (*Client) CancelComputeJob ¶ added in v0.3.0
func (c *Client) CancelComputeJob(ctx context.Context, sessionId string, jobId string, ifMatch string) (state string, err error)
CancelComputeJob requests cancellation of a SAS Viya Compute job.
func (*Client) CancelComputeSession ¶ added in v0.3.0
func (c *Client) CancelComputeSession(ctx context.Context, sessionId string, ifMatch string) (state string, err error)
CancelComputeSession requests cancellation of running work in a SAS Viya Compute session.
func (*Client) CancelJobExecutionJob ¶ added in v0.3.0
CancelJobExecutionJob cancels a Job Execution job.
func (*Client) CreateBatchFileSet ¶
func (c *Client) CreateBatchFileSet(ctx context.Context, contextId string) (resp BatchFileSet, err error)
CreateBatchFileSet creates a SAS Viya Batch file set for the supplied context ID.
func (*Client) CreateBatchJob ¶
func (c *Client) CreateBatchJob(ctx context.Context, req SubmitBatchJobRequest) (resp BatchJob, err error)
CreateBatchJob submits a SAS Viya Batch job.
req.FileSetID should identify a file set that contains the SAS program named by req.SASProgramName and any related input files.
func (*Client) CreateComputeJob ¶ added in v0.3.0
func (c *Client) CreateComputeJob(ctx context.Context, sessionId string, req CreateComputeJobRequest) (resp ComputeJob, err error)
CreateComputeJob executes SAS code asynchronously in a SAS Viya Compute session.
func (*Client) CreateComputeSession ¶ added in v0.3.0
func (c *Client) CreateComputeSession(ctx context.Context, contextId string, req CreateComputeSessionRequest) (resp ComputeSession, err error)
CreateComputeSession creates a Compute session from the specified context definition.
func (*Client) DeleteBatchFileSet ¶
DeleteBatchFileSet deletes a SAS Viya Batch file set.
SAS Viya can reject deletion with HTTP 409 when the file set is still referenced by another resource, such as a job.
func (*Client) DeleteBatchJob ¶
DeleteBatchJob deletes a SAS Viya Batch job.
func (*Client) DeleteBatchServer ¶ added in v0.3.0
DeleteBatchServer deletes a reusable SAS Viya Batch server.
func (*Client) DeleteComputeJob ¶ added in v0.3.0
DeleteComputeJob deletes a SAS Viya Compute job and its session access points.
func (*Client) DeleteComputeSession ¶ added in v0.3.0
DeleteComputeSession deletes a SAS Viya Compute session.
func (*Client) DownloadBatchFile ¶
func (c *Client) DownloadBatchFile(ctx context.Context, fileSetId string, fileName string) (content []byte, err error)
DownloadBatchFile downloads a file from a SAS Viya Batch file set.
func (*Client) DownloadFile ¶ added in v0.3.0
DownloadFile downloads content from the SAS Viya Files Service.
func (*Client) GetBatchContextByName ¶ added in v0.3.0
func (c *Client) GetBatchContextByName(ctx context.Context, name string) (resp BatchContext, err error)
GetBatchContextByName returns a SAS Viya Batch execution context by name.
func (*Client) GetBatchContexts ¶
func (c *Client) GetBatchContexts(ctx context.Context) (resp BatchContextsResponse, err error)
GetBatchContexts returns the available SAS Viya Batch execution contexts.
func (*Client) GetBatchFile ¶
func (c *Client) GetBatchFile(ctx context.Context, fileSetId string) (resp BatchFileResponse, err error)
GetBatchFile returns files in a SAS Viya Batch file set.
func (*Client) GetBatchFileInfo ¶
func (c *Client) GetBatchFileInfo(ctx context.Context, fileSetId string, fileName string) (resp BatchFile, err error)
GetBatchFileInfo returns metadata for one file in a SAS Viya Batch file set.
func (*Client) GetBatchFileSetsInfo ¶
func (c *Client) GetBatchFileSetsInfo(ctx context.Context, id string) (resp BatchFileSet, err error)
GetBatchFileSetsInfo returns metadata for a single SAS Viya Batch file set.
func (*Client) GetBatchFileSetsList ¶
func (c *Client) GetBatchFileSetsList(ctx context.Context) (resp BatchFileSetsResponse, err error)
GetBatchFileSetsList returns the available SAS Viya Batch file sets.
func (*Client) GetBatchJobInfo ¶
GetBatchJobInfo returns details for a SAS Viya Batch job.
func (*Client) GetBatchJobOutput ¶ added in v0.3.0
func (c *Client) GetBatchJobOutput(ctx context.Context, jobId string) (resp BatchJobOutput, err error)
GetBatchJobOutput retrieves STDOUT and STDERR text from a running SAS Viya Batch job.
func (*Client) GetBatchJobState ¶ added in v0.3.0
GetBatchJobState returns the plain-text state for a SAS Viya Batch job.
func (*Client) GetBatchJobsList ¶
func (c *Client) GetBatchJobsList(ctx context.Context) (resp BatchJobsResponse, err error)
GetBatchJobsList returns SAS Viya Batch jobs visible to the caller.
func (*Client) GetBatchServerInfo ¶ added in v0.3.0
func (c *Client) GetBatchServerInfo(ctx context.Context, serverId string) (resp BatchServer, err error)
GetBatchServerInfo returns details for a reusable SAS Viya Batch server.
func (*Client) GetBatchServersList ¶ added in v0.3.0
func (c *Client) GetBatchServersList(ctx context.Context) (resp BatchServersResponse, err error)
GetBatchServersList returns reusable SAS Viya Batch servers visible to the caller.
func (*Client) GetCASLibs ¶ added in v0.3.0
func (c *Client) GetCASLibs(ctx context.Context, serverID string, opts ListOptions) (resp CASLibsResponse, err error)
GetCASLibs returns CAS libraries for a CAS server.
func (*Client) GetCASServers ¶ added in v0.3.0
func (c *Client) GetCASServers(ctx context.Context, opts ListOptions) (resp CASServersResponse, err error)
GetCASServers returns CAS servers visible to the caller.
func (*Client) GetCASTableColumns ¶ added in v0.3.0
func (c *Client) GetCASTableColumns(ctx context.Context, serverID string, caslibName string, tableName string, opts ListOptions) (resp CASTableColumnsResponse, err error)
GetCASTableColumns returns column metadata for a CAS table.
func (*Client) GetCASTableDataColumns ¶ added in v0.3.0
func (c *Client) GetCASTableDataColumns(ctx context.Context, serverID string, caslibName string, tableName string, opts ListOptions) (resp CASTableColumnsResponse, err error)
GetCASTableDataColumns returns column metadata from the dataTables API.
func (*Client) GetCASTableInfo ¶ added in v0.3.0
func (c *Client) GetCASTableInfo(ctx context.Context, serverID string, caslibName string, tableName string) (resp CASTable, err error)
GetCASTableInfo returns metadata for a CAS table.
func (*Client) GetCASTableRows ¶ added in v0.3.0
func (c *Client) GetCASTableRows(ctx context.Context, serverID string, caslibName string, tableName string, opts ListOptions) (resp CASTableRowsResponse, err error)
GetCASTableRows returns sample rows from a CAS table using dataTables and rowSets.
func (*Client) GetCASTables ¶ added in v0.3.0
func (c *Client) GetCASTables(ctx context.Context, serverID string, caslibName string, opts ListOptions) (resp CASTablesResponse, err error)
GetCASTables returns tables in a CAS library.
func (*Client) GetComputeContextInfo ¶ added in v0.3.0
func (c *Client) GetComputeContextInfo(ctx context.Context, contextId string) (resp ComputeContext, err error)
GetComputeContextInfo returns a single SAS Viya Compute context definition.
func (*Client) GetComputeContexts ¶ added in v0.3.0
func (c *Client) GetComputeContexts(ctx context.Context) (resp ComputeContextsResponse, err error)
GetComputeContexts returns available SAS Viya Compute context definitions.
func (*Client) GetComputeJobInfo ¶ added in v0.3.0
func (c *Client) GetComputeJobInfo(ctx context.Context, sessionId string, jobId string) (resp ComputeJob, err error)
GetComputeJobInfo returns information about a SAS Viya Compute job.
func (*Client) GetComputeJobListing ¶ added in v0.3.0
func (c *Client) GetComputeJobListing(ctx context.Context, sessionId string, jobId string) (resp ComputeLogLinesResponse, err error)
GetComputeJobListing returns listing lines for a SAS Viya Compute job.
func (*Client) GetComputeJobListingText ¶ added in v0.3.0
func (c *Client) GetComputeJobListingText(ctx context.Context, sessionId string, jobId string) (text string, err error)
GetComputeJobListingText returns the job listing as plain text.
func (*Client) GetComputeJobLog ¶ added in v0.3.0
func (c *Client) GetComputeJobLog(ctx context.Context, sessionId string, jobId string) (resp ComputeLogLinesResponse, err error)
GetComputeJobLog returns log lines for a SAS Viya Compute job.
func (*Client) GetComputeJobLogText ¶ added in v0.3.0
func (c *Client) GetComputeJobLogText(ctx context.Context, sessionId string, jobId string) (text string, err error)
GetComputeJobLogText returns the job log as plain text.
func (*Client) GetComputeJobState ¶ added in v0.3.0
func (c *Client) GetComputeJobState(ctx context.Context, sessionId string, jobId string) (state string, err error)
GetComputeJobState returns the plain-text state for a SAS Viya Compute job.
func (*Client) GetComputeJobsList ¶ added in v0.3.0
func (c *Client) GetComputeJobsList(ctx context.Context, sessionId string) (resp ComputeJobsResponse, err error)
GetComputeJobsList returns current jobs for a SAS Viya Compute session.
func (*Client) GetComputeSessionInfo ¶ added in v0.3.0
func (c *Client) GetComputeSessionInfo(ctx context.Context, sessionId string) (resp ComputeSession, err error)
GetComputeSessionInfo returns information about a SAS Viya Compute session.
func (*Client) GetComputeSessionState ¶ added in v0.3.0
func (c *Client) GetComputeSessionState(ctx context.Context, sessionId string) (state string, err error)
GetComputeSessionState returns the plain-text state for a SAS Viya Compute session.
func (*Client) GetComputeSessionsList ¶ added in v0.3.0
func (c *Client) GetComputeSessionsList(ctx context.Context) (resp ComputeSessionsResponse, err error)
GetComputeSessionsList returns active SAS Viya Compute sessions visible to the caller.
func (*Client) GetConfiguration ¶
GetConfiguration returns configuration instances for a SAS Viya definition name.
definitionName is passed to /configuration/configurations as the definitionName query parameter. The response body is returned as a string because configuration shapes are dynamic.
func (*Client) GetFiles ¶ added in v0.3.0
func (c *Client) GetFiles(ctx context.Context, opts FileListOptions) (resp ViyaFilesResponse, err error)
GetFiles returns files visible to the caller in the SAS Viya Files Service.
func (*Client) GetIdentitiesLDAPUser ¶
GetIdentitiesLDAPUser retrieves the LDAP user provider configuration.
The configuration service returns dynamic payloads, so the configuration is represented as map[string]any.
func (*Client) GetIdentitiesUsers ¶
func (c *Client) GetIdentitiesUsers(ctx context.Context) (identitiesUserResp IdentitiesUsersResp, err error)
GetIdentitiesUsers returns up to 100 SAS Viya identity users.
func (*Client) GetJobExecutionJob ¶ added in v0.3.0
func (c *Client) GetJobExecutionJob(ctx context.Context, jobID string) (resp JobExecutionJob, err error)
GetJobExecutionJob returns details for a SAS Viya Job Execution job.
func (*Client) GetJobExecutionJobLog ¶ added in v0.3.0
GetJobExecutionJobLog retrieves the log text for a Job Execution job when available.
func (*Client) GetJobExecutionJobs ¶ added in v0.3.0
func (c *Client) GetJobExecutionJobs(ctx context.Context, opts ListOptions) (resp JobExecutionJobsResponse, err error)
GetJobExecutionJobs returns Job Execution jobs visible to the caller.
func (*Client) LoadCASTableToMemory ¶ added in v0.3.0
func (c *Client) LoadCASTableToMemory(ctx context.Context, serverID string, caslibName string, tableName string, replace bool, scope string) error
LoadCASTableToMemory loads a table from a CAS library into memory.
serverID identifies the CAS server. caslibName and tableName identify the CAS library and table. replace controls whether an existing in-memory table can be replaced, and scope is passed to the CAS Management API state-change request.
func (*Client) PatchIdentitiesLDAPGroup ¶
func (c *Client) PatchIdentitiesLDAPGroup(ctx context.Context, updates map[string]any) (bool, error)
PatchIdentitiesLDAPGroup updates the LDAP provider configuration with the supplied values.
NOTE: Despite the method name, this updates the LDAP user provider configuration. The name is preserved for source compatibility.
func (*Client) PromoteCASTable ¶ added in v0.3.0
func (c *Client) PromoteCASTable(ctx context.Context, serverID string, caslibName string, tableName string) (resp CASTable, err error)
PromoteCASTable promotes a CAS table to global scope.
A promoted table is visible outside the session that created it.
func (*Client) RefreshIdentitiesCache ¶
RefreshIdentitiesCache triggers a refresh of the identities cache in SAS Viya.
func (*Client) SendBatchJobInput ¶ added in v0.3.0
SendBatchJobInput sends STDIN text lines to a running SAS Viya Batch job.
func (*Client) SetComputeJobState ¶ added in v0.3.0
func (c *Client) SetComputeJobState(ctx context.Context, sessionId string, jobId string, state string, ifMatch string) (newState string, err error)
SetComputeJobState updates the state of a SAS Viya Compute job.
SAS Viya requires the current ETag in ifMatch for this operation.
func (*Client) SetComputeSessionState ¶ added in v0.3.0
func (c *Client) SetComputeSessionState(ctx context.Context, sessionId string, state string, ifMatch string) (newState string, err error)
SetComputeSessionState updates the state of a SAS Viya Compute session.
SAS Viya requires the current ETag in ifMatch for this operation.
func (*Client) SubmitJobExecutionCode ¶ added in v0.3.0
func (c *Client) SubmitJobExecutionCode(ctx context.Context, req SubmitJobExecutionCodeRequest) (resp JobExecutionJob, err error)
SubmitJobExecutionCode submits SAS code as an asynchronous Job Execution job.
func (*Client) TokenURL ¶
TokenURL returns the SAS Logon OAuth2 token endpoint for the client's base URL.
SAS Logon API reference: https://developer.sas.com/rest-apis/SASLogon
func (*Client) UnloadCASTableFromMemory ¶ added in v0.3.0
func (c *Client) UnloadCASTableFromMemory(ctx context.Context, serverID string, caslibName string, tableName string) error
UnloadCASTableFromMemory unloads a table from CAS memory.
In SAS Visual Analytics workflows, unloading a table can let reports reload the latest source data the next time they access the table.
func (*Client) UpdateIdentitiesLDAPObjectFilter ¶
func (c *Client) UpdateIdentitiesLDAPObjectFilter(ctx context.Context, usernames []string) (bool, error)
UpdateIdentitiesLDAPObjectFilter updates the LDAP object filter to include only the specified usernames.
func (*Client) UploadBatchFile ¶
func (c *Client) UploadBatchFile(ctx context.Context, fileSetId string, fileName string, content []byte) (err error)
UploadBatchFile uploads or replaces a file in a SAS Viya Batch file set.
func (*Client) UploadBatchFileFromReader ¶ added in v0.3.0
func (c *Client) UploadBatchFileFromReader(ctx context.Context, fileSetId string, fileName string, r io.Reader) (err error)
UploadBatchFileFromReader uploads or replaces a file in a SAS Viya Batch file set from content read from r.
func (*Client) UploadCSVToCASTable ¶ added in v0.3.0
func (c *Client) UploadCSVToCASTable(ctx context.Context, serverID string, caslibName string, tableName string, csv []byte) (resp CASTable, err error)
UploadCSVToCASTable uploads CSV data into a CAS table.
The CSV data should include a header row. The target table is created in caslibName on serverID using the supplied tableName.
func (*Client) UploadCSVToCASTableFromReader ¶ added in v0.3.0
func (c *Client) UploadCSVToCASTableFromReader(ctx context.Context, serverID string, caslibName string, tableName string, r io.Reader) (resp CASTable, err error)
UploadCSVToCASTableFromReader uploads CSV data from r into a CAS table.
The CSV data should include a header row. The target table is created in caslibName on serverID using the supplied tableName.
func (*Client) UploadFile ¶ added in v0.3.0
func (c *Client) UploadFile(ctx context.Context, fileName string, contentType string, content []byte) (resp ViyaFile, err error)
UploadFile uploads content to the SAS Viya Files Service.
func (*Client) UploadFileFromReader ¶ added in v0.3.0
func (c *Client) UploadFileFromReader(ctx context.Context, fileName string, contentType string, r io.Reader) (resp ViyaFile, err error)
UploadFileFromReader uploads content from r to the SAS Viya Files Service.
func (*Client) WaitBatchJobCompleted ¶
func (c *Client) WaitBatchJobCompleted(ctx context.Context, jobId string, interval time.Duration) (jobInfo BatchJob, err error)
WaitBatchJobCompleted polls a SAS Viya Batch job until it reaches a terminal state.
It returns the final job details when the job state is "completed" or "failed". The wait stops early when ctx is canceled or GetBatchJobInfo returns an error. In that case, the returned BatchJob contains the most recent job details, if any.
type ClientCredentialsTokenProvider ¶
type ClientCredentialsTokenProvider struct {
// contains filtered or unexported fields
}
ClientCredentialsTokenProvider provides bearer tokens using the OAuth2 client credentials flow.
It is also used as the shared credential holder by Password/AuthCode providers.
func NewClientCredentialsTokenProvider ¶
func NewClientCredentialsTokenProvider(baseURL, clientID, clientSecret string) (*ClientCredentialsTokenProvider, error)
NewClientCredentialsTokenProvider creates a token provider for service-to-service authentication.
baseURL must be the SAS Viya deployment root. clientID and clientSecret must identify a SAS Logon OAuth client that is allowed to use client credentials.
type ComputeContext ¶ added in v0.3.0
type ComputeContext struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
LaunchType string `json:"launchType"`
QueueName string `json:"queueName"`
LaunchContext map[string]any `json:"launchContext,omitempty"`
Attributes map[string]any `json:"attributes,omitempty"`
MediaTypeMap map[string]string `json:"mediaTypeMap,omitempty"`
Resources []ComputeExternalResource `json:"resources,omitempty"`
Environment *ComputeEnvironment `json:"environment,omitempty"`
CreatedBy string `json:"createdBy"`
CreationTime time.Time `json:"creationTimeStamp"`
ModifiedBy string `json:"modifiedBy"`
ModifiedTime time.Time `json:"modifiedTimeStamp"`
Version int `json:"version"`
Links []Link `json:"links"`
}
ComputeContext describes a SAS Viya Compute context definition.
type ComputeContextsResponse ¶ added in v0.3.0
type ComputeContextsResponse = ListResponse[ComputeContext]
ComputeContextsResponse is a collection of SAS Viya Compute contexts.
type ComputeEnvironment ¶ added in v0.3.0
type ComputeEnvironment struct {
Options []string `json:"options,omitempty"`
InitCode []string `json:"initCode,omitempty"`
}
ComputeEnvironment provides SAS options and initialization code for Compute sessions and jobs.
type ComputeExternalResource ¶ added in v0.3.0
type ComputeExternalResource struct {
Name string `json:"name,omitempty"`
URI string `json:"uri,omitempty"`
Type string `json:"type,omitempty"`
Scope string `json:"scope,omitempty"`
Options map[string]any `json:"options,omitempty"`
}
ComputeExternalResource describes a resource requested for a Compute session or job.
type ComputeJob ¶ added in v0.3.0
type ComputeJob struct {
ID string `json:"id"`
SessionID string `json:"sessionId"`
Name string `json:"name"`
Description string `json:"description"`
State string `json:"state"`
JobConditionCode int `json:"jobConditionCode"`
CreationTime time.Time `json:"creationTimeStamp"`
CompletedTime time.Time `json:"completedTimeStamp"`
LogStatistics *ComputeOutputStatistics `json:"logStatistics,omitempty"`
ListingStatistics *ComputeOutputStatistics `json:"listingStatistics,omitempty"`
Version int `json:"version"`
Links []Link `json:"links"`
}
ComputeJob describes a SAS Viya Compute job submitted to a session.
type ComputeJobsResponse ¶ added in v0.3.0
type ComputeJobsResponse = ListResponse[ComputeJob]
ComputeJobsResponse is a collection of SAS Viya Compute jobs.
type ComputeLogLine ¶ added in v0.3.0
ComputeLogLine describes one line of Compute log or listing output.
type ComputeLogLinesResponse ¶ added in v0.3.0
type ComputeLogLinesResponse = ListResponse[ComputeLogLine]
ComputeLogLinesResponse is a collection of Compute log or listing lines.
type ComputeOutputStatistics ¶ added in v0.3.0
type ComputeOutputStatistics struct {
LineCount int `json:"lineCount"`
ModifiedTimeStamp time.Time `json:"modifiedTimeStamp"`
}
ComputeOutputStatistics describes line-oriented Compute output metadata.
type ComputeSession ¶ added in v0.3.0
type ComputeSession struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
State string `json:"state"`
Owner string `json:"owner"`
ServerID string `json:"serverId"`
ServiceAPIVersion int `json:"serviceAPIVersion"`
SessionConditionCode int `json:"sessionConditionCode"`
StateElapsedTime int `json:"stateElapsedTime"`
Environment *ComputeEnvironment `json:"environment,omitempty"`
Attributes map[string]any `json:"attributes,omitempty"`
Resources []ComputeExternalResource `json:"resources,omitempty"`
LogStatistics *ComputeOutputStatistics `json:"logStatistics,omitempty"`
ListingStatistics *ComputeOutputStatistics `json:"listingStatistics,omitempty"`
CreationTimeStamp time.Time `json:"creationTimeStamp"`
Version int `json:"version"`
Links []Link `json:"links"`
}
ComputeSession describes a SAS Viya Compute session.
type ComputeSessionsResponse ¶ added in v0.3.0
type ComputeSessionsResponse = ListResponse[ComputeSession]
ComputeSessionsResponse is a collection of SAS Viya Compute sessions.
type ConfigurationsResp ¶
type ConfigurationsResp = ListResponse[map[string]any]
ConfigurationsResp is a SAS Viya configuration collection response.
Configuration payloads vary by definition, so items are represented as map[string]any.
type CreateComputeJobRequest ¶ added in v0.3.0
type CreateComputeJobRequest struct {
Version int `json:"version,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Environment *ComputeEnvironment `json:"environment,omitempty"`
Variables map[string]any `json:"variables,omitempty"`
Code []string `json:"code,omitempty"`
CodeURI string `json:"codeUri,omitempty"`
Resources []ComputeExternalResource `json:"resources,omitempty"`
Attributes map[string]any `json:"attributes,omitempty"`
}
CreateComputeJobRequest is the request body for submitting SAS code to a Compute session.
type CreateComputeSessionRequest ¶ added in v0.3.0
type CreateComputeSessionRequest struct {
Version int `json:"version,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Attributes map[string]any `json:"attributes,omitempty"`
Environment *ComputeEnvironment `json:"environment,omitempty"`
Resources []ComputeExternalResource `json:"resources,omitempty"`
}
CreateComputeSessionRequest is the request body for creating a Compute session.
type ErrorResponse ¶
type ErrorResponse struct {
Version int `json:"version"`
Accept string `json:"accept,omitempty"`
HTTPStatusCode int `json:"httpStatusCode,omitempty"`
Message string `json:"message,omitempty"`
Details []string `json:"details,omitempty"`
ErrorInfo *struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"error,omitempty"`
}
ErrorResponse represents a structured SAS Viya error response.
func (ErrorResponse) Error ¶
func (e ErrorResponse) Error() string
Error returns the most useful message from a SAS Viya error payload.
type FileListOptions ¶ added in v0.3.0
FileListOptions configures SAS Viya Files Service collection paging and filtering.
type IdentitiesUsers ¶
type IdentitiesUsers struct {
ID string `json:"id"`
Name string `json:"name"`
ProviderId string `json:"providerId"`
Type string `json:"type"`
Description string `json:"description"`
State string `json:"state"`
}
IdentitiesUsers describes a user entry returned by the SAS Viya Identities API.
type IdentitiesUsersResp ¶
type IdentitiesUsersResp = ListResponse[IdentitiesUsers]
IdentitiesUsersResp is a collection of SAS Viya identity users.
type JobExecutionError ¶ added in v0.3.0
type JobExecutionError struct {
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
}
JobExecutionError describes an error returned on a SAS Viya Job Execution job.
type JobExecutionJob ¶ added in v0.3.0
type JobExecutionJob struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
State string `json:"state,omitempty"`
CreatedBy string `json:"createdBy,omitempty"`
CreationTimeStamp time.Time `json:"creationTimeStamp,omitempty"`
ModifiedBy string `json:"modifiedBy,omitempty"`
ModifiedTimeStamp time.Time `json:"modifiedTimeStamp,omitempty"`
Results map[string]string `json:"results,omitempty"`
Error *JobExecutionError `json:"error,omitempty"`
Links []Link `json:"links,omitempty"`
Version int `json:"version,omitempty"`
}
JobExecutionJob describes a SAS Viya Job Execution service job.
type JobExecutionJobsResponse ¶ added in v0.3.0
type JobExecutionJobsResponse = ListResponse[JobExecutionJob]
JobExecutionJobsResponse is a collection of SAS Viya Job Execution jobs.
type LauncherOptions ¶
type LauncherOptions struct {
BatchContextID string `json:"batchContextId"`
JobName string `json:"jobName"`
RequiredResources string `json:"requiredResources"`
WorkloadQueueName string `json:"workloadQueueName"`
}
LauncherOptions configures how SAS Viya Batch launches a job.
type Link ¶
type Link struct {
Method string `json:"method"`
Rel string `json:"rel"`
Href string `json:"href"`
URI string `json:"uri"`
Type string `json:"type,omitempty"`
}
Link describes a hypermedia link returned by SAS Viya REST APIs.
Many SAS Viya resources include action links such as "self", "update", or "delete"; callers can use these when an API response provides the canonical URL.
type ListOptions ¶ added in v0.3.0
ListOptions configures SAS Viya collection paging.
type ListResponse ¶
type ListResponse[T any] struct { Version int `json:"version"` Accept string `json:"accept"` Count int `json:"count"` Start int `json:"start"` Limit int `json:"limit"` Items []T `json:"items"` Links []Link `json:"links"` }
ListResponse represents a standard SAS Viya collection response.
Collection responses usually include paging fields, items, and links. For details on SAS Viya REST API conventions, see: https://developer.sas.com/docs/rest-apis/getting-started/authentication
type Metadata ¶
type Metadata struct {
CreationTimeStamp string `json:"creationTimeStamp"`
CreatedBy string `json:"createdBy"`
ModifiedTimeStamp string `json:"modifiedTimeStamp"`
ModifiedBy string `json:"modifiedBy"`
IsDefault bool `json:"isDefault"`
MediaType string `json:"mediaType"`
Services []string `json:"services"`
}
Metadata contains metadata fields commonly returned by SAS Viya configuration resources.
type Option ¶
type Option func(*clientOptions)
Option configures a Client.
func WithRoundTripper ¶
func WithRoundTripper(rt http.RoundTripper) Option
WithRoundTripper configures the HTTP transport used by the underlying Resty client. It is primarily useful for tests, tracing, proxies, or custom TLS settings.
func WithTokenProvider ¶
func WithTokenProvider(provider TokenProvider) Option
WithTokenProvider configures a provider that supplies bearer tokens for each request. Token lookup happens lazily in request middleware so callers' contexts can cancel token fetches.
type PasswordTokenProvider ¶
type PasswordTokenProvider struct {
*ClientCredentialsTokenProvider
// contains filtered or unexported fields
}
PasswordTokenProvider provides bearer tokens using the OAuth2 password flow.
This flow requires SAS Logon to allow password grants for the configured OAuth client.
type SubmitBatchJobRequest ¶
type SubmitBatchJobRequest struct {
FileSetID string `json:"fileSetId"`
LauncherOptions LauncherOptions `json:"launcherOptions"`
RestartType string `json:"restartType"`
SASProgramName string `json:"sasProgramName"`
SASOptions string `json:"sasOptions"`
WatchOutput bool `json:"watchOutput"`
OutputDir string `json:"outputDir"`
LogFile string `json:"logFile"`
ListFile string `json:"listFile"`
Version int `json:"version"`
}
SubmitBatchJobRequest is the request body for creating a SAS Viya Batch job.
type SubmitJobExecutionCodeRequest ¶ added in v0.3.0
SubmitJobExecutionCodeRequest is the request for submitting SAS code through Job Execution.
type TokenProvider ¶
TokenProvider supplies bearer tokens for authenticated SAS Viya requests.
Implementations may use SAS Logon OAuth2 grants, cached tokens, or an external credential source. Implementations should honor ctx cancellation where possible. In distributed services, implement this interface with your own shared cache, secret storage, refresh-token rotation, and cross-instance locking strategy. This package intentionally consumes only bearer access tokens and does not expose refresh tokens. SAS Logon API reference: https://developer.sas.com/rest-apis/SASLogon
func NewAuthCodeTokenProvider ¶
func NewAuthCodeTokenProvider(baseURL, code string, opts ...TokenProviderOption) (TokenProvider, error)
NewAuthCodeTokenProvider creates a token provider that exchanges an OAuth2 authorization code.
baseURL must be the SAS Viya deployment root. Use WithOAuthClient to pass the OAuth client registration that issued the code.
func NewPasswordTokenProvider ¶
func NewPasswordTokenProvider(baseURL, username, password string, opts ...TokenProviderOption) (TokenProvider, error)
NewPasswordTokenProvider creates a token provider that authenticates with username and password.
baseURL must be the SAS Viya deployment root. Use WithOAuthClient to override the default OAuth client ID or provide a client secret.
type TokenProviderOption ¶
type TokenProviderOption func(*tokenProviderOptions)
TokenProviderOption configures token providers that use SAS Logon OAuth2 clients.
func WithOAuthClient ¶
func WithOAuthClient(clientID, clientSecret string) TokenProviderOption
WithOAuthClient configures the OAuth2 client used by password and authorization-code flows.
clientSecret is optional for public clients.
func WithOAuthClientProvider ¶
func WithOAuthClientProvider(provider *ClientCredentialsTokenProvider) TokenProviderOption
WithOAuthClientProvider reuses base URL and OAuth2 client settings from an existing ClientCredentialsTokenProvider.
type ViyaFile ¶ added in v0.3.0
type ViyaFile struct {
ID string `json:"id"`
Name string `json:"name"`
ContentType string `json:"contentType,omitempty"`
Size int64 `json:"size,omitempty"`
CreatedBy string `json:"createdBy,omitempty"`
CreationTimeStamp time.Time `json:"creationTimeStamp,omitempty"`
ModifiedBy string `json:"modifiedBy,omitempty"`
ModifiedTimeStamp time.Time `json:"modifiedTimeStamp,omitempty"`
Links []Link `json:"links,omitempty"`
Version int `json:"version,omitempty"`
}
ViyaFile describes a file stored in the SAS Viya Files Service.
type ViyaFilesResponse ¶ added in v0.3.0
type ViyaFilesResponse = ListResponse[ViyaFile]
ViyaFilesResponse is a collection of SAS Viya Files Service files.
Source Files
¶
- batch_contexts.go
- batch_file_sets.go
- batch_files.go
- batch_jobs.go
- batch_servers.go
- cas_data_operations.go
- cas_discovery.go
- cas_table_state.go
- client.go
- compute_contexts.go
- compute_jobs.go
- compute_output.go
- compute_sessions.go
- compute_types.go
- configuration.go
- files.go
- identities.go
- job_execution.go
- otel.go
- provider.go
- response.go
- token.go
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
batch-job
command
|
|
|
cas-table-state
command
|
|
|
client-credentials
command
|
|
|
configuration
command
|
|
|
default-client
command
|
|
|
distributed-token-provider
command
|
|
|
password-flow
command
|
|
|
viya-cli
command
|