viya

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 19 Imported by: 0

README

go-viya

CI Go Reference Go Report Card

go-viya is a Go client library for selected SAS Viya REST APIs. It follows the REST protocols and media types documented at https://developer.sas.com/rest-apis, and provides token providers, a Resty-backed client, and helpers for identities, configuration, batch, CAS table operations, files, and Job Execution jobs.

Installation

go get github.com/dingdayu/go-viya

Quick Start

package main

import (
	"context"
	"log"

	"github.com/dingdayu/go-viya"
)

func main() {
	ctx := context.Background()
	baseURL := "https://viya.example.com"

	tokens, err := viya.NewClientCredentialsTokenProvider(
		baseURL,
		"client-id",
		"client-secret",
	)
	if err != nil {
		log.Fatal(err)
	}

	client := viya.NewClient(ctx, baseURL, viya.WithTokenProvider(tokens))

	users, err := client.GetIdentitiesUsers(ctx)
	if err != nil {
		log.Fatal(err)
	}

	log.Printf("users: %d", users.Count)
}

Authentication

The client accepts any implementation of:

type TokenProvider interface {
	Token(ctx context.Context) (string, error)
}

Built-in providers:

  • NewClientCredentialsTokenProvider(baseURL, clientID, clientSecret)
  • NewPasswordTokenProvider(baseURL, username, password, opts...)
  • NewAuthCodeTokenProvider(baseURL, code, opts...)

Password and authorization-code flows can reuse OAuth client settings:

provider, err := viya.NewPasswordTokenProvider(
	baseURL,
	"username",
	"password",
	viya.WithOAuthClient("client-id", "client-secret"),
)
Distributed services

The built-in providers cache and refresh tokens in the current Go process. This is suitable for command-line tools, tests, and simple services, but it is not a distributed token cache.

For multi-instance deployments, implement TokenProvider in your application and keep refresh-token handling behind your own operational boundary. A typical implementation reads a valid access token from a shared cache or internal authentication service, refreshes it with a distributed lock before expiry, and stores refresh tokens in a secret manager such as Vault, KMS-backed storage, or your platform's secret store.

go-viya intentionally asks only for a bearer access token. It does not expose refresh tokens, because refresh-token storage, rotation, revocation, encryption, auditing, tenant isolation, and cross-instance locking are deployment-specific security concerns.

type DistributedTokenProvider struct {
	cache SharedTokenCache
}

func (p DistributedTokenProvider) Token(ctx context.Context) (string, error) {
	token, err := p.cache.AccessToken(ctx)
	if err != nil {
		return "", fmt.Errorf("viya access token: %w", err)
	}
	if token == "" {
		return "", viya.ErrViyaAuthFailed
	}
	return token, nil
}

provider := DistributedTokenProvider{cache: cache}
client := viya.NewClient(ctx, baseURL, viya.WithTokenProvider(provider))

See examples/ for complete custom provider and workflow examples.

Examples

  • examples/client-credentials: create a client with OAuth2 client credentials and list identity users.
  • examples/password-flow: use the OAuth2 password grant when SAS Logon allows it.
  • examples/distributed-token-provider: connect go-viya to an application-managed shared token cache.
  • examples/configuration: read a dynamic SAS Viya configuration definition.
  • examples/default-client: configure and retrieve the process-wide default client.
  • examples/batch-job: create a file set, upload a SAS program, submit a batch job, and wait for completion.
  • examples/cas-table-state: load and optionally unload a CAS table.
  • examples/viya-cli: CLI for agents to execute SAS code, discover and manage CAS data, use Viya files, and submit Job Execution jobs.

API Basis

This package is implemented against the public SAS Viya REST API documentation:

The API surface is intentionally small and grows around tested SAS Viya workflows. It is not a generated client for every SAS Viya endpoint.

Supported Features

Current implemented areas include:

  • Authentication:
    • OAuth2 client credentials token provider.
    • OAuth2 password token provider.
    • OAuth2 authorization-code token provider.
    • Custom TokenProvider support.
  • Default client wiring:
    • Set, get, and must-get helpers for a process-wide default client.
  • Identities:
    • Refresh the identities cache.
    • List identity users.
    • Read LDAP user configuration.
    • Patch LDAP group configuration.
    • Update LDAP object filters from usernames.
  • Configuration:
    • Read configuration definitions.
  • Batch:
    • List batch contexts and inspect contexts by name.
    • List, create, inspect, and delete batch file sets.
    • List, inspect, download, and upload files in batch file sets.
    • List, create, inspect, delete, cancel, wait for, and retrieve state/output for batch jobs.
    • Send STDIN to running batch jobs.
    • List, inspect, and delete reusable batch servers.
  • Compute:
    • List and inspect compute contexts.
    • List, create, inspect, cancel, and delete compute sessions.
    • List, create, inspect, cancel, delete, and retrieve state for compute jobs.
    • Retrieve compute job log and listing output as collections or plain text.
  • CAS:
    • Load CAS library tables to memory.
    • Unload CAS library tables from memory.
    • Discover CAS servers, caslibs, tables, columns, and sample rows.
    • Upload CSV data into CAS tables.
    • Promote CAS tables to global scope.
  • Files:
    • List, upload, and download SAS Viya Files Service files.
  • Job Execution:
    • Submit SAS code as an asynchronous Job Execution job.
    • List, inspect, cancel, and retrieve logs for Job Execution jobs.
  • Observability:
    • OpenTelemetry spans for outbound token requests and client operations.

Development

go test ./...
go test -race ./...
go vet ./...

Before opening a pull request:

gofmt -w .
go mod tidy
go test ./...

Releases

This project uses semantic versioning and Git tags in the form vX.Y.Z.

Create a release by pushing a tag:

git tag v0.1.0
git push origin v0.1.0

The release workflow runs tests and then uses GoReleaser to publish a GitHub Release with generated release notes.

For local release validation:

goreleaser check
goreleaser release --snapshot --clean

For Go module compatibility checks before a public release:

go run golang.org/x/exp/cmd/gorelease@latest -base=latest

gorelease may fail before the first public version exists; after the first tag, use it to catch accidental API breakage.

License

This project is licensed under the MIT License. See LICENSE.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDefaultClientNotSet = errors.New("viya default client is not set")

ErrDefaultClientNotSet is returned when the process-wide default client has not been configured.

View Source
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.

func (*AuthCodeTokenProvider) Token

Token exchanges the configured authorization code for a bearer token, then refreshes the cached token as needed.

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

type BatchJobInputRequest struct {
	Input   []string `json:"input"`
	Version int      `json:"version"`
}

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

func GetDefaultClient() (*Client, error)

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

func NewClient(ctx context.Context, baseURL string, opts ...Option) *Client

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

func (c *Client) CancelBatchJob(ctx context.Context, jobId string) (err error)

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

func (c *Client) CancelJobExecutionJob(ctx context.Context, jobID string) (err error)

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

func (c *Client) DeleteBatchFileSet(ctx context.Context, fileSetId string) (err error)

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

func (c *Client) DeleteBatchJob(ctx context.Context, jobId string) (err error)

DeleteBatchJob deletes a SAS Viya Batch job.

func (*Client) DeleteBatchServer added in v0.3.0

func (c *Client) DeleteBatchServer(ctx context.Context, serverId string) (err error)

DeleteBatchServer deletes a reusable SAS Viya Batch server.

func (*Client) DeleteComputeJob added in v0.3.0

func (c *Client) DeleteComputeJob(ctx context.Context, sessionId string, jobId string) (err error)

DeleteComputeJob deletes a SAS Viya Compute job and its session access points.

func (*Client) DeleteComputeSession added in v0.3.0

func (c *Client) DeleteComputeSession(ctx context.Context, sessionId string) (err error)

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

func (c *Client) DownloadFile(ctx context.Context, fileID string) (content []byte, err error)

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

func (c *Client) GetBatchJobInfo(ctx context.Context, jobId string) (resp BatchJob, err error)

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

func (c *Client) GetBatchJobState(ctx context.Context, jobId string) (state string, err error)

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

func (c *Client) GetConfiguration(ctx context.Context, definitionName string) (string, error)

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

func (c *Client) GetIdentitiesLDAPUser(ctx context.Context) (map[string]any, error)

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

func (c *Client) GetJobExecutionJobLog(ctx context.Context, jobID string) (string, error)

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

func (c *Client) RefreshIdentitiesCache(ctx context.Context) (success bool, err error)

RefreshIdentitiesCache triggers a refresh of the identities cache in SAS Viya.

func (*Client) SendBatchJobInput added in v0.3.0

func (c *Client) SendBatchJobInput(ctx context.Context, jobId string, input []string) (err error)

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

func (c *Client) TokenURL() string

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.

func (*ClientCredentialsTokenProvider) Token

Token returns a bearer token from SAS Logon, refreshing the cached token as needed.

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

type ComputeLogLine struct {
	Line string `json:"line"`
	Type string `json:"type"`
}

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

type FileListOptions struct {
	Start      int
	Limit      int
	FilterName string
}

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 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

type ListOptions struct {
	Start int
	Limit int
}

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.

func (*PasswordTokenProvider) Token

Token returns a bearer token for the configured username and password, refreshing the cached token as needed.

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

type SubmitJobExecutionCodeRequest struct {
	Name        string
	Code        string
	ContextName string
}

SubmitJobExecutionCodeRequest is the request for submitting SAS code through Job Execution.

type TokenProvider

type TokenProvider interface {
	Token(ctx context.Context) (string, error)
}

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.

Directories

Path Synopsis
examples
batch-job command
cas-table-state command
configuration command
default-client command
password-flow command
viya-cli command

Jump to

Keyboard shortcuts

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