SAS Viya Orders REST API
SAS Viya Orders
Base URLs:
- https://api.sas.com/mysas
Email: SAS Developers Web: SAS Developers License: SAS Institute Inc.
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
SAS Viya Orders API
Usage Notes
Overview
The SAS Viya Orders API enables users to download content needed for SAS Viya software deployments and updates through api.sas.com in a scripted environment. Use this API to download deployment assets, software licenses, and certificates.
For a command-line interface to this API, see SAS Viya Orders CLI.
For details about deploying SAS Viya, see SAS Viya Operations Guide.
Terminology
cadence
the interval at which software is released and supported.
cadence name
the name associated with a release and support schedule.
cadence version
the version associated with a particular release.
certificates
a ZIP file that contains an entitlement certificate and a SAS Certificate Authority (CA). Required when using
SAS Mirror Manager.
deployment assets
a TGZ file that contains Kubernetes Resources, Kustomize Overlays , and examples for deploying SAS Viya software into a Kubernetes cluster.
entitlement certificate
a certificate for authenticating to SAS distribution infrastructure to access content for a software order.
license
a file that contains licensing information for an order in the form of a JWT.
SAS Mirror Manager
a command-line utility that pulls SAS open container images from the SAS registry and pushes the images to the customer's container registry, which can be either on-premise or in the cloud.
order
a unit by which customers purchase SAS software.
order asset
a file or information needed to deploy or update SAS Viya software that can be obtained via the My Viya Orders tab in My SAS or the SAS Viya Orders API.
a command-line interface to the SAS Viya Orders API.
Software Order Email
a message, emailed to a customer site, that announces the availability of purchased software and describes the order. The message contains download and preliminary installation steps as applicable.
Error Codes
For errors thrown explicitly by this service, a standard SAS error object (media type: application/vnd.sas.error) is returned.
HTTP status code | Status | Description |
---|---|---|
400 | Bad Request | The request was invalid for the given order; for example, the cadence name or version were incorrect. |
404 | Not Found | Either the given API endpoint URL was not valid or the order number in the request does not exist. |
Operations
Orders
Orders endpoints.
Gets a certificates file
Code samples
# You can also use wget
curl -X GET https://api.sas.com/mysas/orders/{orderNumber}/certificates \
-H 'Accept: application/octet-stream' \
-H 'Authorization: Bearer {access-token}'
const headers = {
'Accept':'application/octet-stream',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.sas.com/mysas/orders/{orderNumber}/certificates',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/octet-stream',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.sas.com/mysas/orders/{orderNumber}/certificates', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/octet-stream"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.sas.com/mysas/orders/{orderNumber}/certificates", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /orders/{orderNumber}/certificates
Gets a certificates file for the given order.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orderNumber | path | string | true | The Order Number string. |
Example responses
200 Response
400 Response
{
"details": [
"string"
],
"errorCode": 0,
"errors": [
null
],
"httpStatusCode": 0,
"id": "string",
"links": [
{
"href": "string",
"method": "string",
"rel": "string",
"type": "string",
"uri": "string"
}
],
"message": "string",
"remediation": "string",
"version": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Certificates as a ZIP file | string |
400 | Bad Request | Bad Request | error |
404 | Not Found | Not Found | error |
Gets the deployment assets
Code samples
# You can also use wget
curl -X GET https://api.sas.com/mysas/orders/{orderNumber}/cadenceNames/{cadenceName}/deploymentAssets \
-H 'Accept: application/octet-stream' \
-H 'Authorization: Bearer {access-token}'
const headers = {
'Accept':'application/octet-stream',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.sas.com/mysas/orders/{orderNumber}/cadenceNames/{cadenceName}/deploymentAssets',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/octet-stream',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.sas.com/mysas/orders/{orderNumber}/cadenceNames/{cadenceName}/deploymentAssets', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/octet-stream"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.sas.com/mysas/orders/{orderNumber}/cadenceNames/{cadenceName}/deploymentAssets", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /orders/{orderNumber}/cadenceNames/{cadenceName}/deploymentAssets
Gets the deployment assets for the given order at the latest version of the given cadence name.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orderNumber | path | string | true | The Order Number string. |
cadenceName | path | string | true | The Cadence Name string. |
Example responses
200 Response
404 Response
{
"details": [
"string"
],
"errorCode": 0,
"errors": [
null
],
"httpStatusCode": 0,
"id": "string",
"links": [
{
"href": "string",
"method": "string",
"rel": "string",
"type": "string",
"uri": "string"
}
],
"message": "string",
"remediation": "string",
"version": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | the deployment assets as a TGZ file | string |
404 | Not Found | Not Found | error |
Gets a license file
Code samples
# You can also use wget
curl -X GET https://api.sas.com/mysas/orders/{orderNumber}/cadenceNames/{cadenceName}/cadenceVersions/{cadenceVersion}/license \
-H 'Accept: application/octet-stream' \
-H 'Authorization: Bearer {access-token}'
const headers = {
'Accept':'application/octet-stream',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.sas.com/mysas/orders/{orderNumber}/cadenceNames/{cadenceName}/cadenceVersions/{cadenceVersion}/license',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/octet-stream',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.sas.com/mysas/orders/{orderNumber}/cadenceNames/{cadenceName}/cadenceVersions/{cadenceVersion}/license', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/octet-stream"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.sas.com/mysas/orders/{orderNumber}/cadenceNames/{cadenceName}/cadenceVersions/{cadenceVersion}/license", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /orders/{orderNumber}/cadenceNames/{cadenceName}/cadenceVersions/{cadenceVersion}/license
Gets a license file for the given order at the given cadence name / version.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orderNumber | path | string | true | The Order Number string. |
cadenceName | path | string | true | The Cadence Name string. |
cadenceVersion | path | string | true | The Cadence Version string. |
Example responses
200 Response
400 Response
{
"details": [
"string"
],
"errorCode": 0,
"errors": [
null
],
"httpStatusCode": 0,
"id": "string",
"links": [
{
"href": "string",
"method": "string",
"rel": "string",
"type": "string",
"uri": "string"
}
],
"message": "string",
"remediation": "string",
"version": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | License as a .jwt file (contains a JWT) | string |
400 | Bad Request | Bad Request | error |
404 | Not Found | Not Found | error |
Schemas
error
{
"details": [
"string"
],
"errorCode": 0,
"errors": [
null
],
"httpStatusCode": 0,
"id": "string",
"links": [
{
"href": "string",
"method": "string",
"rel": "string",
"type": "string",
"uri": "string"
}
],
"message": "string",
"remediation": "string",
"version": 0
}
Error object
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
details | [string] | false | none | A collection of strings that provide detailed information about the cause of the error |
errorCode | integer(int64) | false | none | An optional error code that can be set to indicate the error more precisely |
errors | [error] | false | none | A nested array of root causes or related errors |
httpStatusCode | integer(int64) | false | none | The HTTP status code (e.g., 404) |
id | string | false | none | An optional mnemonic string representing the error status |
links | [link] | false | none | A collection of Link objects |
message | string | false | none | The message text |
remediation | string | false | none | An optional string that indicates possible remedial steps |
version | integer(int64) | false | none | The version of the Error object |
link
{
"href": "string",
"method": "string",
"rel": "string",
"type": "string",
"uri": "string"
}
Link object
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
href | string | false | none | The absolute URL for the resource. |
method | string | false | none | The HTTP method for the resource. |
rel | string | false | none | A relationship to the requested resource. |
type | string | false | none | The media type for the resource. |
uri | string | false | none | The relative URI (Uniform Resource Identifier) for the resource. |
Examples
Media Type Samples
SAS Media Types
application/octet-stream
A response in the form of an octet stream.
application/vnd.sas.error
The SAS standard error format. See application/vnd.sas.error.
Resource Reference
Note that all GET operations have a corresponding HEAD operation with identical API and behavior except that no response body is returned.
Resource: Certificates
This resource represents certificates.
Media Type
Path: /orders/{orderNumber}/certificates
A GET
to this endpoint returns certificates by order number.
Resource: Deployment Assets
This resource represents deployment assets.
Media Type
Path: /orders/{orderNumber}/cadenceNames/{cadenceName}/cadenceVersions/{cadenceVersion}/deploymentAssets
A GET
to this endpoint returns deployment assets by order number at a given cadence name and version.
Path: /orders/{orderNumber}/cadenceNames/{cadenceName}/deploymentAssets
A GET
to this endpoint returns deployment assets by order number at the latest version of a given cadence name.
Resource: License
This resource represents a license.
Media Type
Path: /orders/{orderNumber}/cadenceNames/{cadenceName}/cadenceVersions/{cadenceVersion}/license
A GET
to this endpoint returns a license by order number at a given cadence name and version.