ApiMethod

com.google.api.server.spi.config

Annotation Type ApiMethod



  • @Retention(value=RUNTIME)
     @Target(value=METHOD)
    public @interface ApiMethod
    Annotation for API method configuration.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element and Description
      AnnotationBoolean apiKeyRequired
      Whether or not an API key is required.
      java.lang.String[] audiences
      Audience for IdTokens.
      java.lang.Class<? extends Authenticator>[] authenticators
      Custom authenticators used for authentication for this method.
      AuthLevel authLevel
      Set frontend auth level.
      ApiMethodCacheControl cacheControl
      Deprecated. 
      ApiMethodCacheControl is deprecated and will be removed in a future version of Cloud Endpoints.
      java.lang.String[] clientIds
      Client IDs allowed to call this method.
      java.lang.String description
      Description of this API method.
      java.lang.String httpMethod
      The HTTP method to use to access this method.
      AnnotationBoolean ignored
      Whether or not API method should be ignored.
      ApiIssuerAudience[] issuerAudiences
      Audiences for individual issuers.
      ApiMetricCost[] metricCosts
      A list of metric costs associated with this method.
      java.lang.String name
      The name for this method in the .api file.
      java.lang.String path
      The URI path to use to access this method.
      java.lang.Class<? extends PeerAuthenticator>[] peerAuthenticators
      Custom peer authenticators used to verify peer for this method.
      java.lang.String[] scopes
      OAuth 2 scopes, one of which is required for calling this method.
    • Element Detail

      • name

        public abstract java.lang.String name
        The name for this method in the .api file. This will automatically be prefixed with "<apiname>." to create a unique name for the method. If not set the method name will be derived from the Java method name.
        Default:
        ""
      • description

        public abstract java.lang.String description
        Description of this API method. This will be exposed in the discovery service to describe your API method, and may also be used to generate documentation.
        Default:
        ""
      • path

        public abstract java.lang.String path
        The URI path to use to access this method. If not set a default will be created based on the Java method name.
        Default:
        ""
      • httpMethod

        public abstract java.lang.String httpMethod
        The HTTP method to use to access this method. If not set a default will be chosen based on the name of the method.
        Default:
        ""
      • cacheControl

        @Deprecated
        public abstract ApiMethodCacheControl cacheControl
        Deprecated. ApiMethodCacheControl is deprecated and will be removed in a future version of Cloud Endpoints.
        Cache-Control header settings for this method. See ApiMethodCacheControl for details.
        Default:
        @com.google.api.server.spi.config.ApiMethodCacheControl
      • authLevel

        public abstract AuthLevel authLevel
        Set frontend auth level.
        Default:
        com.google.api.server.spi.config.AuthLevel.UNSPECIFIED
      • scopes

        public abstract java.lang.String[] scopes
        OAuth 2 scopes, one of which is required for calling this method.
        Default:
        "_UNSPECIFIED_LIST_STRING_VALUE"
      • audiences

        public abstract java.lang.String[] audiences
        Audience for IdTokens.
        Default:
        "_UNSPECIFIED_LIST_STRING_VALUE"
      • issuerAudiences

        public abstract ApiIssuerAudience[] issuerAudiences
        Audiences for individual issuers. This is only meant to be used with EspAuthenticator in endpoints-framework-auth.
        Default:
        @com.google.api.server.spi.config.ApiIssuerAudience(name="_UNSPECIFIED_LIST_STRING_VALUE", audiences="_UNSPECIFIED_LIST_STRING_VALUE")
      • clientIds

        public abstract java.lang.String[] clientIds
        Client IDs allowed to call this method.
        Default:
        "_UNSPECIFIED_LIST_STRING_VALUE"
      • authenticators

        public abstract java.lang.Class<? extends Authenticator>[] authenticators
        Custom authenticators used for authentication for this method.
        Default:
        com.google.api.server.spi.config.Authenticator.class
      • peerAuthenticators

        public abstract java.lang.Class<? extends PeerAuthenticator>[] peerAuthenticators
        Custom peer authenticators used to verify peer for this method.
        Default:
        <error>
      • ignored

        public abstract AnnotationBoolean ignored
        Whether or not API method should be ignored.
        Default:
        com.google.api.server.spi.config.AnnotationBoolean.UNSPECIFIED
      • apiKeyRequired

        public abstract AnnotationBoolean apiKeyRequired
        Whether or not an API key is required. This is used to output a Swagger specification and has no effect unless used with endpoints-management-control-appengine.
        Default:
        com.google.api.server.spi.config.AnnotationBoolean.UNSPECIFIED
      • metricCosts

        public abstract ApiMetricCost[] metricCosts
        A list of metric costs associated with this method.
        Default:
        {}
Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Endpoints Frameworks for App Engine
Need help? Visit our support page.