RemoteApiOptions

com.google.appengine.tools.remoteapi

Class RemoteApiOptions

  • java.lang.Object
    • com.google.appengine.tools.remoteapi.RemoteApiOptions


  • public class RemoteApiOptions
    extends java.lang.Object
    A mutable object containing settings for installing the remote API.

    Example for connecting to a development app server:

     RemoteApiOptions options = new RemoteApiOptions()
         .server("localhost", 8888),
         .useDevelopmentServerCredential();
     

    Example for connecting to a deployed app:

     RemoteApiOptions options = new RemoteApiOptions()
         .server("myappid.appspot.com", 443),
         .useApplicationDefaultCredential();
     

    The options should be passed to RemoteApiInstaller.install(com.google.appengine.tools.remoteapi.RemoteApiOptions).

    • Constructor Detail

      • RemoteApiOptions

        public RemoteApiOptions()
    • Method Detail

      • server

        public RemoteApiOptions server(java.lang.String newHostname,
                                       int newPort)
        Sets the host and port port where we will connect.
      • credentials

        @Deprecated
        public RemoteApiOptions credentials(java.lang.String newUserEMail,
                                                        java.lang.String newPassword)
        Deprecated. Use useApplicationDefaultCredential() or useServiceAccountCredential instead.
        Sets a username and password to be used for logging in via the ClientLogin API. Overrides any previously-provided credentials.
      • reuseCredentials

        public RemoteApiOptions reuseCredentials(java.lang.String newUserEmail,
                                                 java.lang.String serializedCredentials)
        Reuses credentials from another AppEngineClient. Credentials can only be reused from a client with the same hostname and user. Overrides any previously-provided credentials.
        Parameters:
        newUserEmail - the email address of the user we want to log in as.
        serializedCredentials - a string returned by calling AppEngineClient.serializeCredentials() on the previous client
      • useComputeEngineCredential

        @Deprecated
        public RemoteApiOptions useComputeEngineCredential()
        Use a Compute Engine credential for authentication. Overrides any previously-provided credentials.
        Returns:
        this RemoteApiOptions instance
      • useApplicationDefaultCredential

        public RemoteApiOptions useApplicationDefaultCredential()
        Use a Google Application Default credential for authentication. Overrides any previously-provided credentials.
        Returns:
        this RemoteApiOptions instance.
        See Also:
        Application Default Credentials
      • useServiceAccountCredential

        public RemoteApiOptions useServiceAccountCredential(java.lang.String serviceAccountId,
                                                            java.lang.String p12PrivateKeyFile)
        Use a service account credential. Overrides any previously-provided credentials.
        Parameters:
        serviceAccountId - service account ID (typically an e-mail address)
        p12PrivateKeyFile - p12 file containing a private key to use with the service account
        Returns:
        this RemoteApiOptions instance
      • useServiceAccountCredential

        public RemoteApiOptions useServiceAccountCredential(java.lang.String serviceAccountId,
                                                            java.security.PrivateKey privateKey)
        Use a service account credential. Overrides any previously-provided credentials.
        Parameters:
        serviceAccountId - service account ID (typically an e-mail address)
        privateKey - private key to use with the service account