You are here: Machine Registration > addEntitlementFingerprint

Add Entitlement Fingerprint

Description

This Web service registers on-premise machines with an entitlement in Cloud Connect database. A machine can be registered with only one entitlement.

Notes

Default Protocol Method Type URI
HTTPS POST addEntitlementFingerprint.xml

Post Parameters

Parameter Description Valid Values Optional
fingerPrintContractInfo Input XML containing list of fingerprints and respective EIDs. String No

Input XML

The input of this Web service should be properly encoded to handle special characters.

<FingerPrintDetails>
  <EntitlementList>
    <Entitlement>
      <Eid>5881d433-68b5-4bb8-8809-1ec6a7e439d5</Eid>
      <FingerprintList>
        <Fingerprint>
          <FingerprintFriendlyName>fingerprint1</FingerprintFriendlyName>
          <CustomFingerprint>Noi151010</CustomFingerprint>
          <FingerprintValue>
            <hasp_info>
              <host_fingerprint type="SL-AdminMode" crc="956404683">MXhJSSPcKFRyIA2aASAaqk2qxTeuopU7ctmq4Yn7YyTicAk+UKqYVMn1oHl8IaLhItxx5qguyg+gcTaSQr8IWfXqTkYY0SJi1SlmhQNIRQ==</host_fingerprint>
              <host_fingerprint type="SL-UserMode" crc="4283274314">MnhJSSPAoA8njiPnmANwGkhEsynM9a7iFBgieMIWEpj7Zyz0IGuiHU6qgIT5YwcsgRQjihEMVqRShCAgqo8QS5bNG4eAiFrUbgsXqw30ImYRkTYPgEpYRA==</host_fingerprint>
            </hasp_info>
          </FingerprintValue>
        </Fingerprint>
      </FingerprintList>
    </Entitlement>
  </EntitlementList>
</FingerPrintDetails>
 

Understanding Input XML

The above values should be unique for a customer.

Registration Criteria

It is decided beforehand what criteria will be used for registering machines for a customer. The criteria can be:

Sample Code

import java.io.IOException;
//..............................
//..............................
//..............................
import org.apache.http.params.HttpParams;
public class EMSSample {
	private static DefaultHttpClient httpclient = new DefaultHttpClient();
	private static Principal principal = null;
	//..............................
	//..............................
	//..............................
	public static String addEntitlementFingerprint.xml()throws Exception {
		if(!verifyLogin()){
			return "login failed";
		}
		HttpContext context = new BasicHttpContext();
		context.setAttribute(ClientContext.USER_TOKEN, principal);
		HttpPost post =  new HttpPost("https://localhost:8443/ems/3.6/addEntitlementFingerprint.xml");
		List<NameValuePair> nvps = new ArrayList<NameValuePair>();
		nvps.add(new BasicNameValuePair("fingerPrintContractInfo", ""));
		post.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
		HttpResponse response = httpclient.execute(post, context);
		HttpEntity entity = response.getEntity();
		byte[] b = null;
		if (entity != null) {
			long l = entity.getContentLength();
			b = new byte[(int) l];
			entity.getContent().read(b);
			entity.consumeContent();
		}
		return new String(b);
	}
}


Sample Response

<?xml version="1.0" encoding="UTF-8"?> 
<emsResponse>
  <saved>true</saved>
  <stat>ok</stat>
</emsResponse>
See Also:

Output Format for Failure

Error Codes

Error Code Description
101 You are not authorized to use this service.
128 You should log on first.
1020 Invalid XML string provided. Provide a valid XML
1110 FingerprintFriendlyName cannot be blank. Provide a valid XML.
1111 Fingerprint value cannot be blank. Provide a valid XML.
1114 Invalid XML string provided. Provide a valid XML.
1120 The FingerprintValue or friendlyname is not unique for the contract.Please provide the unique values.
1121 Entitlement does not exist. Provide a valid EID.
1122 Entitlement is not of type On-premise Entitlement Level.
1123 EID cannot be blank.Please provide a valid xml.
1124 fingerPrintContractInfo cannot be empty.Please provide a valid input.
1127 Fingerprint friendly name cannot be greater than 255 characters.
1128 Fingerprint cannot be registered for a revoked contract.
1129 Error occurred while decoding the fingerprint value. Please contact the system administrator for further assistance.
1131 VendorCode is either null or empty for the tenant.
1133 Invalid Tenant Id in use.
1136 Invalid criteria for finger print matching. Please contact the system administrator for further details.
1137 Invalid primary criteria.
1138 CustomFingerprint is mandatory. Please provide a valid value.
1139 CustomFingerprint value should be unique for a customer.
1144 Invalid length of CustomFingerprint. Maximum allowed length is 255.