Skip to content
This repository was archived by the owner on Jul 14, 2022. It is now read-only.

Services

Will Witman edited this page Feb 16, 2015 · 13 revisions

Understanding remote services

This topic introduces remote services and explains how to use them in your A-127 projects.

What are remote services?

Apigee-127 account providers can expose remote services. For instance, the apigee account provider currently exposes a RemoteProxy service. This service allows apps to talk to a proxy that is deployed on Apigee Edge that provides OAuth 2.0 endpoints for generating tokens and authorization codes. If you want to use Apigee OAuth, simply bind the RemoteProxy service to your project.

Once a service is bound to a project, that service will be available no matter where you deploy it. For example, if you deploy your project to an Amazon or Heroku account, you can access the service.

Service configuration information is stored in ~/.a127/services.

What has changed?

After the release of services for A-127, the apigee-remote-proxy is no longer automatically created and deployed when you create an A-127 apigee account. And, the apigeeProxyKey and apigeeProxyUri values are no longer added to apigee accounts as they were before.

It's easy to create and bind services to projects, as explained below.

When you delete an account, Apigee-127 asks you if you wish to delete any services associated with that account.

Using remote services

Services are exposed through A-127 accounts. So, the first thing to do is create an account that exposes one or more services. Then, you can create a new service instance and bind it to an existing A-127 project.

To see which services are available for the currently selected A-127 account:

`a127 service types`

Use the a127 command-line tool to create, bind, list, and delete remotes services. For details, see Apigee-127 command-line reference.

The basic flow for using services is:

  1. Create an Apigee-127 account: a127 account create

  2. Create a service: a127 service create (required if you were not prompted to create a service during account creation)

  3. Create a project: a127 project create

  4. Bind the service to the project: a127 project bind

  5. If necessary, deploy the project: a127 project deploy

Note: You only have to deploy the project if it was alreday (previously) deployed.

For details on these a127 commands, see "a127 reference". Or, type a127 [command] [option] -h for help. For example, a127 service create -h

Referencing services in Swagger files

To configure a service in your Swagger file, use the x-a127-config extension:

    x-a127-config:
      ApigeeRemote.key: &apigeeProxyKey CONFIGURED
      ApigeeRemote.uri: &apigeeProxyUri CONFIGURED
      ...

In this configuration:

  • ApigeeRemote is the user-specified name of the remote service. You can get a list of service names with a127 service list.
  • key and uri are service-specific values. In the case of RemoteProxy service, key and uri are required values.
  • & signifies a variable that can be referenced later in the Swagger file, like this:
    oauth2:
        provider: "volos-oauth-apigee"
        options:
          ## Needed for remote proxy service
          key: *apigeeProxyKey
          uri: *apigeeProxyUri
    ...
Clone this wiki locally