Skip to content

Instantly share code, notes, and snippets.

@rogeruiz
Last active September 18, 2023 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogeruiz/c9861b3cbf9d70a893003564c95efa04 to your computer and use it in GitHub Desktop.
Save rogeruiz/c9861b3cbf9d70a893003564c95efa04 to your computer and use it in GitHub Desktop.
MB-12251 Prime Actions using HTTPie (https://httpie.io)

MB-12251 Prime Action to validate

Using this set of scripts, run the get-exp-certs-out-of-chamber.sh first. Run this file from inside of the transcom/mymove repo. Then after that, open the request-payload.json file and edit the moveTaskOrderID to match a GUID for a Move that the Prime will create an MTO shipment for. After saving request-payload.json, run the create-mto-shipment-as-prime.sh to modify the Move. You should see a 200 response in the terminal.

Running the scripts

All scripts are run by calling bash first before typing the path to the script. Do not run this script within the transcom/mymove repository as it will download certificates into your repository.

#!/bin/bash
https -v --verify=no \
--cert=./move_mil_dod_tls_cert.pem \
--cert-key=./move_mil_dod_tls_key.pem \
POST \
api.exp.dp3.us/prime/v1/mto-shipments < ./request-payload.json
#!/bin/bash
where_to_save='/tmp/mb-12251/'
DISABLE_AWS_VAULT_WRAPPER=1 \
AWS_REGION=us-gov-west-1 \
aws-vault exec \
transcom-gov-milmove-exp \
-- \
chamber read app-exp move_mil_dod_tls_cert -q > ${where_to_save}move_mil_dod_tls_cert.pem
DISABLE_AWS_VAULT_WRAPPER=1 \
AWS_REGION=us-gov-west-1 \
aws-vault exec \
transcom-gov-milmove-exp \
-- \
chamber read app-exp move_mil_dod_tls_key -q > ${where_to_save}move_mil_dod_tls_key.pem
{
"moveTaskOrderID": "Please fill this out with a Move GUID",
"createdAt": "2022-05-16 18:18:19.457027",
"updatedAt": "2022-05-16 18:18:19.457028",
"requestedPickupDate" : "2020-03-16",
"requestedDeliveryDate" : "2020-03-16",
"diversion": false,
"pickupAddress" : {
"streetAddress1": "123 Main Ave",
"city": "Portsmouth",
"state": "NH",
"postalCode": "03801"
},
"shipmentType": "HHG"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment