Update a context definition

put/contexts/{contextId}
Internal-Use Only

Updates a context definition. Changing a context does not affect any sessions that are currently running on the server that is instantiated by that context. Servers that are created after updating the context use the current definition. If the contextId matches the ID of an existing context, that context is updated. Otherwise, an error is returned. The request must include the current ETag of the context as the value of the If-Match request header to prevent concurrent updates. The current ETag of the context is provided in the value of the ETag response header of any endpoint that produces application/vnd.sas.compute.context.

Request Samples

1

Response Samples

1{
2 "description": "My Application Context",
3 "links": [
4 {
5 "method": "GET",
6 "rel": "self",
7 "href": "/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12",
8 "uri": "/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12",
9 "type": "application/vnd.sas.compute.context"
10 },
11 {
12 "method": "GET",
13 "rel": "alternate",
14 "href": "/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12",
15 "uri": "/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12",
16 "type": "application/vnd.sas.compute.context.summary"
17 },
18 {
19 "method": "PUT",
20 "rel": "update",
21 "href": "/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12",
22 "uri": "/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12",
23 "type": "application/vnd.sas.compute.context",
24 "responseType": "application/vnd.sas.compute.context"
25 },
26 {
27 "method": "PUT",
28 "rel": "updateWithRules",
29 "href": "/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12",
30 "uri": "/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12",
31 "type": "application/vnd.sas.compute.context.request",
32 "responseType": "application/vnd.sas.compute.context"
33 },
34 {
35 "method": "DELETE",
36 "rel": "delete",
37 "href": "/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12",
38 "uri": "/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12"
39 },
40 {
41 "method": "POST",
42 "rel": "createSession",
43 "href": "/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12/sessions",
44 "uri": "/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12/sessions",
45 "type": "application/vnd.sas.compute.session.request",
46 "responseType": "application/vnd.sas.compute.session"
47 },
48 {
49 "method": "GET",
50 "rel": "rules",
51 "href": "/authorization/rules?filter=eq(objectUri,'/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12/sessions')",
52 "uri": "/authorization/rules?filter=eq(objectUri,'/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12/sessions')",
53 "type": "application/vnd.sas.collection",
54 "responseType": "application/vnd.sas.authorization.rule"
55 }
56 ],
57 "launchType": "service",
58 "launchContext": {
59 "contextName": "compsrv"
60 },
61 "attributes": {
62 "sessionInactiveTimeout": 60
63 },
64 "mediaTypeMap": {
65 "csv": "application/vnd.ms-excel"
66 },
67 "createdBy": "myUserID",
68 "modifiedBy": "myUserID",
69 "modifiedTimeStamp": "2018-05-04T18:02:27.780000Z",
70 "creationTimeStamp": "2018-05-04T18:02:27.749000Z",
71 "id": "309b3f0b-cda8-4c2b-9089-82a07a4fff12",
72 "version": 4,
73 "name": "MyApp",
74 "queueName": "MyAppQueue",
75 "resources": [
76 {
77 "name": "file1",
78 "uri": "/files/files/ea0d3ee1-894f-4936-bc2b-f611a878a0dd",
79 "type": "application/vnd.sas.file",
80 "scope": "SESSION",
81 "options": {
82 "LRECL": 1024
83 }
84 }
85 ]
86}

Path Parameters

NameTypeRequiredDescription
contextId
string
true

Specifies the ID of the context definition.

Header Parameters

NameTypeRequiredDescription
If-Match
string
true

Specifies the current ETag of the context that you are updating.

Request Body

context definition

Provides information about the context that is stored for a service.

Example:
{"description":"My Application Context","links":[{"method":"GET","rel":"self","href":"/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12","uri":"/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12","type":"application/vnd.sas.compute.context"},{"method":"GET","rel":"alternate","href":"/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12","uri":"/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12","type":"application/vnd.sas.compute.context.summary"},{"method":"PUT","rel":"update","href":"/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12","uri":"/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12","type":"application/vnd.sas.compute.context","responseType":"application/vnd.sas.compute.context"},{"method":"PUT","rel":"updateWithRules","href":"/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12","uri":"/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12","type":"application/vnd.sas.compute.context.request","responseType":"application/vnd.sas.compute.context"},{"method":"DELETE","rel":"delete","href":"/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12","uri":"/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12"},{"method":"POST","rel":"createSession","href":"/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12/sessions","uri":"/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12/sessions","type":"application/vnd.sas.compute.session.request","responseType":"application/vnd.sas.compute.session"},{"method":"GET","rel":"rules","href":"/authorization/rules?filter=eq(objectUri,'/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12/sessions')","uri":"/authorization/rules?filter=eq(objectUri,'/compute/contexts/309b3f0b-cda8-4c2b-9089-82a07a4fff12/sessions')","type":"application/vnd.sas.collection","responseType":"application/vnd.sas.authorization.rule"}],"launchType":"service","launchContext":{"contextName":"compsrv"},"attributes":{"sessionInactiveTimeout":60},"mediaTypeMap":{"csv":"application/vnd.ms-excel"},"createdBy":"myUserID","modifiedBy":"myUserID","modifiedTimeStamp":"2018-05-04T18:02:27.780000Z","creationTimeStamp":"2018-05-04T18:02:27.749000Z","id":"309b3f0b-cda8-4c2b-9089-82a07a4fff12","version":4,"name":"MyApp","queueName":"MyAppQueue","resources":[{"name":"file1","uri":"/files/files/ea0d3ee1-894f-4936-bc2b-f611a878a0dd","type":"application/vnd.sas.file","scope":"SESSION","options":{"LRECL":1024}}]}
NameTypeRequiredDescription
name
string
true

Specifies the localized context name.

description
string
false

Specifies the localized description.

launchContext
Launch Context
true

Provides information about the Launch context that is used by the Compute service.

launchType
string
true

Specifies the type of launcher to use when launching SAS Compute Servers. The only value currently supported is service, which refers to the Launcher service.

attributes
object
false

Specifies the service-defined attributes that were set when this context was created.

environment
SAS Environment
false

Provides the SAS options and initialization code that is used by the Compute service and its sessions.

mediaTypeMap
object
false

Specifies optional information that overrides mappings of file extensions to media types in the sessions that was launched for this context. The session attempts to use file extensions to determine the media type of the files that are returned. Standard IANA type mappings are used. To override the default behavior of the server, specify a mapping from a file extension to a media type name. That media type is then used for that file extension.

links
array [Link]
false

Specifies links that apply to the context.

resources
array [External Resource]
false

Specifies the resources that have been configured for this context.

queueName
string
false

Specifies the name of the workload queue where Compute servers configured from this context should run. If workload queues are not supported, this specification will be ignored. The value of the queue name is limited to 250 characters.

Responses

StatusMeaningDescription
200OKThe request succeeded.HeadersSchema
400Bad RequestThe request was invalid.Schema
404Not FoundNo context definition exists at the requested path.Schema
409ConflictThe updated context included in the request was not based on the most recently saved context. A concurrent request updated the context while this request was in process.Schema
412Precondition FailedThe `If-Match` request header did not match the resource's entity tag, or the `If-Unmodified-Since` request header did not match the resources last modified timestamp.Schema
428Precondition RequiredThe request headers did not include an `If-Match` or `If-Unmodified-Since` precondition.Schema