param args import common = require ( "oci-common" ) ; import * as identity from "oci-identity" ; const provider = new common . ConfigFileAuthenticationDetailsProvider ( ) ; const args = process . argv . slice ( 2 ) ; console . log ( args ) ; if ( args . length !== 1 ) { console . error ( "Unexpected number of arguments received. Consult the script header comments for expected arguments" ) ; process . exit ( - 1 ) ; } const tenancyId = args [ 0 ] ; const identityClient = new identity . IdentityClient ( { authenticationDetailsProvider : provider } ) ; async function getAvailabilityDomain ( ) { const request = { compartmentId : tenancyId } ; request . retryConfiguration = { terminationStrategy : new common . MaxAttemptsTerminationStrategy ( 5 ) , delayStrategy : new common . ExponentialBackoffDelayStrategy ( 30 ) } ; const response = await identityClient . listAvailabilityDomains ( request ) ; return response . items [ 0 ] ; } ( async ( ) => { try { const availabilityDomain = await getAvailabilityDomain ( ) ; console . log ( "Availability Domain :" + availabilityDomain . name ) ; } catch ( error ) { console . log ( "Error executing example" + error ) ; } finally { console . debug ( "DONE" ) ; } } ) ( ) ;