Share via


Update (PUT/MERGE) ConnectionTypes

Update using the HTTP PUT/MERGE operation.

Important

The only allowed update operation is to change the IsBeingCreated property from true to false. This is required after initial creation, before using the ConnectionType instance.

Code Examples

Request

Method Request URI HTTP Version

MERGE

HTTPS://<HOST>:<PORT>/00000000-0000-0000-0000-000000000000/ConnectionTypes(guid'<GUID>')

HTTP/1.1

Request URI Parameters

URI Parameter Description

NAME

Required. The unique identifier value (ConnectionTypeID) for a ConnectionType entity.

Request URI Example

Example URI

MERGE https://sma-server:9090/00000000-0000-0000-0000-000000000000/ConnectionTypes(guid'159fb0d4-8c32-4388-8944-a7ac07678d18') 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

The PUT/MERGE request body.

<?xml version="1.0" encoding="utf-8"?>
<entry 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://smaserver:9090/00000000-0000-0000-0000-000000000000/ConnectionTypes(guid'4deaf6ae-dce0-479f-98d6-19568f204438')</id>
  <category term="Orchestrator.ResourceModel.ConnectionType" scheme="https://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <title />
  <updated>2014-04-29T22:25:53Z</updated>
  <author>
    <name />
  </author>
  <content type="application/xml">
    <m:properties>
      <d:ConnectionTypeID m:type="Edm.Guid">4deaf6ae-dce0-479f-98d6-19568f204438</d:ConnectionTypeID>
      <d:CreationTime m:type="Edm.DateTime">2014-04-29T22:18:19.097</d:CreationTime>
      <d:IsBeingCreated m:type="Edm.Boolean">false</d:IsBeingCreated>
      <d:LastModifiedTime m:type="Edm.DateTime">2014-04-29T22:18:19.097</d:LastModifiedTime>
      <d:Name>ConnectionType Name</d:Name>
      <d:TenantID m:type="Edm.Guid">00000000-0000-0000-0000-000000000000</d:TenantID>
    </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 ConnectionType, identified by the ConnectionTypeID (a unique guid), and updates the IsBeingCreated 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 connectionTypeID = new Guid("5a2744cc-be24-4ba5-b8ad-c1a68818fe0d");

                // Query for the specific ConnectionType instance identified by ConnectionTypeID.
                var connectionType = SMAService.ConnectionTypes.Where(r => r.ConnectionTypeID == connectionTypeID).FirstOrDefault();

                // Modify a ConnectionType instance property.
                connectionType.IsBeingCreated = false;

                // Update the ConnectionType object.
                // Note: This action is queued up until the SaveChanges action is called.
                SMAService.UpdateObject(connectionType);

                // Save all pending actions (client -> server communication initiated).
                SMAService.SaveChanges();
            }
            catch (Exception ex)
            {
                throw new ApplicationException("An error occurred during execution.", ex);
            }
        }                 
    }
}

See Also

Concepts

ConnectionType
ConnectionTypes