Update (PUT/MERGE) ConnectionFieldValues
Update using the HTTP PUT/MERGE operation.
Code Examples
Request
Method | Request URI | HTTP Version |
---|---|---|
MERGE |
HTTPS://<HOST>:<PORT>/00000000-0000-0000-0000-000000000000/ConnectionFieldValues(guid'<GUID>') |
HTTP/1.1 |
Request URI Parameters
URI Parameter | Description |
---|---|
NAME |
Required. The unique identifier value (ConnectionFieldValueID) for a ConnectionFieldValue entity. |
Request URI Example
Example URI |
---|
MERGE https://sma-server:9090/00000000-0000-0000-0000-000000000000/ConnectionFieldValues(guid'cc299ac6-90b6-40d2-9801-473c08f2e841') HTTP/1.1 |
Request Headers
For more information about the common request headers used by this operation, see Standard Service Management Automation POST/GET/PUT/DELETE Headers.
Request Body
<?xml version="1.0" encoding="utf-8"?>
<entry xml:base="https://waplabvm4:9090/00000000-0000-0000-0000-000000000000/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="https://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="https://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<id>https://waplabvm4:9090/00000000-0000-0000-0000-000000000000/ConnectionFieldValues(guid'cc299ac6-90b6-40d2-9801-473c08f2e841')</id>
<category term="Orchestrator.ResourceModel.ConnectionFieldValue" scheme="https://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<link rel="edit" title="ConnectionFieldValue" href="ConnectionFieldValues(guid'cc299ac6-90b6-40d2-9801-473c08f2e841')" />
<link rel="https://schemas.microsoft.com/ado/2007/08/dataservices/related/Connection" type="application/atom+xml;type=entry" title="Connection" href="ConnectionFieldValues(guid'cc299ac6-90b6-40d2-9801-473c08f2e841')/Connection" />
<title />
<updated>2014-04-29T20:06:41Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:TenantID m:type="Edm.Guid">00000000-0000-0000-0000-000000000000</d:TenantID>
<d:ConnectionFieldValueID m:type="Edm.Guid">cc299ac6-90b6-40d2-9801-473c08f2e841</d:ConnectionFieldValueID>
<d:ConnectionID m:type="Edm.Guid">e2de1b47-b08e-43d2-87bc-ee938ed597eb</d:ConnectionID>
<d:ConnectionName>70ad4eaa-dc7b-47c6-b88e-41062c145f2f</d:ConnectionName>
<d:ConnectionTypeID m:type="Edm.Guid">d5bc6612-7d3e-4ac5-8b0c-d28ab21bcd50</d:ConnectionTypeID>
<d:ConnectionTypeName>dd5d5851-7606-4d0d-8fd8-78e21cc07b34</d:ConnectionTypeName>
<d:Value>unencrypted-41c95eb6-4b14-410c-8f28-b54227abe227</d:Value>
<d:ConnectionFieldID m:type="Edm.Guid">ffc6b7e7-d9b4-4bdf-a412-b1e15443c4e5</d:ConnectionFieldID>
<d:ConnectionFieldName>44b3f91e-094b-49e3-8ce2-10fa40b775c0</d:ConnectionFieldName>
<d:IsEncrypted m:type="Edm.Boolean">false</d:IsEncrypted>
<d:IsOptional m:type="Edm.Boolean">true</d:IsOptional>
<d:Type>String</d:Type>
<d:CreationTime m:type="Edm.DateTime">2014-04-29T19:36:51.48</d:CreationTime>
<d:LastModifiedTime m:type="Edm.DateTime">2014-04-29T19:36:51.48</d:LastModifiedTime>
</m:properties>
</content>
</entry>
Response
Response Codes
Response Code | Description |
---|---|
HTTP/1.1 204 No Content |
Request fulfilled. |
Response Headers
For more information about the common response headers used by this operation, see Standard Service Management Automation POST/GET/PUT/DELETE Headers.
Response Body
The PUT/MERGE operation has no response body.
Code Examples
The following example searches for a specific ConnectionFieldValue, identified by the ConnectionFieldValueID (a unique guid), and updates a value.
namespace CodeSample.Microsoft.SystemCenter.SMA
{
public class SMASamples
{
public static void Main()
{
// Replace this with the name of your SMA web service endpoint.
string serviceEndPoint = "https://sma-server:9090/00000000-0000-0000-0000-000000000000";
// Setup the connection to SMA
OrchestratorApi SMAService = new OrchestratorApi(new Uri(serviceEndPoint));
// Set credentials to the default or to a specific user.
((DataServiceContext)SMAService).Credentials = CredentialCache.DefaultCredentials;
//((DataServiceContext)SMAService).Credentials = new NetworkCredential("user", "pwd", "domain");
try
{
// Identify a specific instance to search for.
var connectionFieldValueID = new Guid("cc299ac6-90b6-40d2-9801-473c08f2e841");
// Query for the specific ConnectionFieldValue instance identified by ConnectionFieldValueID.
var connectionFieldValue = SMAService.ConnectionFieldValues.Where(r => r.ConnectionFieldValueID == connectionFieldValueID).FirstOrDefault();
// Modify ConnectionFieldValue instance property.
connectionFieldValue.Value = "Updated Value";
// Update the ConnectionFieldValue object.
// Note: This action is queued up until the SaveChanges action is called.
SMAService.UpdateObject(connectionFieldValue);
// Save all pending actions (client -> server communication initiated).
SMAService.SaveChanges();
}
catch (Exception ex)
{
throw new ApplicationException("An error occurred during execution.", ex);
}
}
}
}