Info |
---|
Since Cloudaware is built on https://force.com/, address Salesforce CLI which is a powerful command line interface that simplifies development and build automation when working with your Salesforce instance. |
...
1. Download and install Salesforce CLI application for your OS using this link.
2. Open Terminal (or Windows Command Prompt) and run the command sfdx
to make sure the application was successfully installed.
...
12. Go back to the section 'Build' on the left → under 'Create' select Apps → select the created app. Under 'Profiles' click Manage Profiles to select profiles of those users who will have access to the app. CloudAware Collector Only and CloudAware Administrator should be selected by default. Click Save.
13. Optional: if you would like to allow all users access the app using their credentials in CLI, select the app → Edit policies → select 'All users may self-authorize' in the section 'OAuth Policies'.
To authorize user access in an already created app, contact the application creator to request a certificate.
Authorize a Salesforce Org for Use with Salesforce CLI
...
If you encounter any errors, make sure to:
Escape ! in Access Token with / slash.
Use single quotes around -H value
Use URL encoded URL
More information about other API calls is available in Salesforce documentation on Working with Records and Working with Searches and Queries.
...
Let's assume we have a 2-column dataset made up of EC2 Instance ID and a custom attribute called ''Demo Version'':
instanceID | Demo Version |
---|---|
i-XXXXXXXXXXXXXXXXA | 3.4 |
i-XXXXXXXXXXXXXXXXB | 3.7 |
… | … |
i-XXXXXXXXXXXXXXXXZ | 3.2 |
Using CLI, we will need to extract instanceID and Salesforce ID in order to create a Salesforce-side dataset that will look like this:
...
If you are not sure how to create a custom field on an existing object such as EC2 Instance or Physical Server, follow the instructions here.
CMDB CURRENT DATA
Salesforce ID | instanceID |
---|---|
a0X4P00000KUkVSUA1 | 3.4 |
a0X4P00000KUkUTUA1 | 3.7 |
… | … |
a0X4P00000LJsniUAD | 3.2 |
We will use sort and merge commands to create a final dataset that will be used to upload the merged dataset. In this merged dataset, records are matched by instanceID but the actual instanceID does not need to be re-imported.
Salesforce ID | Demo Version |
---|---|
a0X4P00000KUkVSUA1 | 3.4 |
a0X4P00000KUkUTUA1 | 3.7 |
… | … |
a0X4P00000LJsniUAD | 3.2 |
sfdx force:data:bulk:upsert -s EC2_Instances -f ./path/to/file.csv -i Salesforce ID