@Override public CredentialType get() { return CredentialType.fromValue(credentialType); } }
@Override public String toString() { return UPPER_UNDERSCORE.to(LOWER_CAMEL, name()); }
public static CredentialType fromValue(String credentialType) { return valueOf(LOWER_CAMEL.to(UPPER_UNDERSCORE, checkNotNull(credentialType, "credentialType"))); } }
public static Properties defaultProperties() { Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.put("oauth.endpoint", "https://cloud.digitalocean.com/v1/oauth/token"); properties.put(JWS_ALG, "RS256"); properties.put(AUDIENCE, "https://cloud.digitalocean.com/v1/oauth/token"); properties.put(CREDENTIAL_TYPE, BEARER_TOKEN_CREDENTIALS.toString()); properties.put(PROPERTY_SESSION_INTERVAL, 3600); properties.put(TEMPLATE, "osFamily=UBUNTU,os64Bit=true,osVersionMatches=16.*"); properties.put(POLL_INITIAL_PERIOD, 5000); properties.put(POLL_MAX_PERIOD, 20000); // Node operations in DigitalOcean can be quite slow. Use a 5 minutes // timeout by default properties.put(TIMEOUT_NODE_RUNNING, 300000); properties.put(TIMEOUT_NODE_SUSPENDED, 300000); properties.put(TIMEOUT_NODE_TERMINATED, 300000); return properties; }
@Override protected Properties setupProperties() { Properties props = super.setupProperties(); props.setProperty(JWS_ALG, jwsAlg); // scope is required for P12_PRIVATE_KEY_CREDENTIALS, optional for CLIENT_CREDENTIALS_SECRET. // Moved the not-NULL check to P12_PRIVATE_KEY_CREDENTIALS specific parameters. scope = setIfTestSystemPropertyPresent(props, "jclouds.oauth.scope"); // Determine which type of Credential to use, default to P12_PRIVATE_KEY_CREDENTIALS credentialType = setIfTestSystemPropertyPresent(props, CREDENTIAL_TYPE); if (credentialType == null) { credentialType = CredentialType.P12_PRIVATE_KEY_CREDENTIALS.toString(); props.setProperty(CREDENTIAL_TYPE, credentialType); } // Set the credential specific properties. if (CredentialType.fromValue(credentialType) == CredentialType.CLIENT_CREDENTIALS_SECRET) { resource = checkNotNull(setIfTestSystemPropertyPresent(props, RESOURCE), "test." + RESOURCE); } else if (CredentialType.fromValue(credentialType) == CredentialType.CLIENT_CREDENTIALS_P12_AND_CERTIFICATE) { audience = checkNotNull(setIfTestSystemPropertyPresent(props, AUDIENCE), "test.jclouds.oauth.audience"); resource = checkNotNull(setIfTestSystemPropertyPresent(props, RESOURCE), "test." + RESOURCE); certificate = setCredential(props, CERTIFICATE); credential = setCredential(props, "oauth.credential"); } else if (CredentialType.fromValue(credentialType) == CredentialType.P12_PRIVATE_KEY_CREDENTIALS) { audience = checkNotNull(setIfTestSystemPropertyPresent(props, AUDIENCE), "test.jclouds.oauth.audience"); credential = setCredential(props, "oauth.credential"); checkNotNull(scope, "test.jclouds.oauth.scope"); } return props; }
public static Properties defaultProperties() { Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.put("oauth.endpoint", "https://cloud.digitalocean.com/v1/oauth/token"); properties.put(JWS_ALG, "RS256"); properties.put(AUDIENCE, "https://cloud.digitalocean.com/v1/oauth/token"); properties.put(CREDENTIAL_TYPE, BEARER_TOKEN_CREDENTIALS.toString()); properties.put(PROPERTY_SESSION_INTERVAL, 3600); properties.put(TEMPLATE, "osFamily=UBUNTU,os64Bit=true,osVersionMatches=14.*"); properties.put(POLL_INITIAL_PERIOD, 5000); properties.put(POLL_MAX_PERIOD, 20000); // Node operations in DigitalOcean can be quite slow. Use a 5 minutes // timeout by default properties.put(TIMEOUT_NODE_RUNNING, 300000); properties.put(TIMEOUT_NODE_SUSPENDED, 300000); properties.put(TIMEOUT_NODE_TERMINATED, 300000); return properties; }
public static Properties defaultProperties() { Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.put("oauth.endpoint", "https://cloud.digitalocean.com/v1/oauth/token"); properties.put(JWS_ALG, "RS256"); properties.put(AUDIENCE, "https://cloud.digitalocean.com/v1/oauth/token"); properties.put(CREDENTIAL_TYPE, BEARER_TOKEN_CREDENTIALS.toString()); properties.put(PROPERTY_SESSION_INTERVAL, 3600); properties.put(TEMPLATE, "osFamily=UBUNTU,os64Bit=true,osVersionMatches=16.*"); properties.put(POLL_INITIAL_PERIOD, 5000); properties.put(POLL_MAX_PERIOD, 20000); // Node operations in DigitalOcean can be quite slow. Use a 5 minutes // timeout by default properties.put(TIMEOUT_NODE_RUNNING, 300000); properties.put(TIMEOUT_NODE_SUSPENDED, 300000); properties.put(TIMEOUT_NODE_TERMINATED, 300000); return properties; }
@Override public CredentialType get() { return CredentialType.fromValue(credentialType); } }
@Override public String toString() { return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name()); }
public static CredentialType fromValue(String credentialType) { return valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(credentialType, "credentialType"))); }
protected Properties setupProperties() { Properties properties = new Properties(); properties.put(CREDENTIAL_TYPE, BEARER_TOKEN_CREDENTIALS.toString()); properties.put("oauth.endpoint", "https://login.microsoftonline.com/tenant-id/oauth2/token"); return properties; }
@Override public CredentialType get() { return CredentialType.fromValue(credentialType); } }
@Override public String toString() { return UPPER_UNDERSCORE.to(LOWER_CAMEL, name()); }
public static CredentialType fromValue(String credentialType) { return valueOf(LOWER_CAMEL.to(UPPER_UNDERSCORE, checkNotNull(credentialType, "credentialType"))); } }
properties.put(CREDENTIAL_TYPE, CLIENT_CREDENTIALS_SECRET.toString()); properties.put(DEFAULT_VNET_ADDRESS_SPACE_PREFIX, "10.0.0.0/16"); properties.put(DEFAULT_SUBNET_ADDRESS_PREFIX, "10.0.0.0/24");
@Override public CredentialType get() { return CredentialType.fromValue(credentialType); } }
@Override public String toString() { return UPPER_UNDERSCORE.to(LOWER_CAMEL, name()); }
public static CredentialType fromValue(String credentialType) { return valueOf(LOWER_CAMEL.to(UPPER_UNDERSCORE, checkNotNull(credentialType, "credentialType"))); } }
properties.put(PROPERTY_SESSION_INTERVAL, 300); properties.put(RESOURCE, "https://management.azure.com/"); properties.put(CREDENTIAL_TYPE, CLIENT_CREDENTIALS_SECRET.toString());
@Override public CredentialType get() { return CredentialType.fromValue(credentialType); } }