0.1.35 • Published 20 days ago

apigee-apim v0.1.35

Weekly downloads
1
License
ISC
Repository
-
Last release
20 days ago

Overview

Apigee-apim is a NPM tool can be used to integrate CICD development for all Apigee implementations:

  • Apigee Edge
  • Apigee X
  • Apigee Hybrid

:info: Apigee X/Hybrid users: keep an eye out for small differences in implementation when using these forms of Apigee.

Setup

Run the following commands to install:

npm install apigee-apim -g

Set environment variables (powershell)

$env:APIGEE_USERNAME=""
$env:APIGEE_PASSWORD=""

Repository

The following repository setup is recommended:

- apiproxy
- config.yaml

In order to extend for different environments:

- apiproxy
- config
  - env1.yaml
  - env2.yaml
  - env3.yaml

Parameters

There is a list of parameters that can be added as options to the commands that are implemented by this tool.

FlagArgumentShorthandRequiredDescription
--org<organization (string)-o:heavy_check_mark:The Apigee target organization
--environment<env> (string)-eThe Apigee target environment
--version<version> (string)-v
--hybrid<accessToken> (string)-hOption to change format for Hybrid. Expects valid GCP auth token
--baseuri <baseuri><baseure> (string)-LOption to overwrite baseUri
--token <accessToken>-t

Apigee Components

The main reason to use the tool is to manipulate the contents of the Apigee management plane. This management plane is either self-managed or managed by Apigee/Google depending on the version of Apigee.

Configuration

This tool uses a configuration file (.yaml) to pass the additional information to the Apigee API. You can extend the usage of the config file to hold variables used by development process of your choice (e.g.: Extend yaml with variables to be read by CICD)

Default components needed by this tool are:

# template of supported configuration
# indentation using spaces

# product configuration
products:
  - name: product1
    description: |
      this is an apigee product named product1
    environments:
      - dev
    proxies:
      - proxy-A
      - proxy-B

# key value map configuration
kvms:
  kvm1:
    encrypted: true
    key1: "{env-variable}"
    key2: "{env-variable2}"
    key3: "plain-variable"

# target server configuration    
targetServers:
  - name: target1
    host: target1.com
  - name: target2
    host: target2.com
    port: 8080
  - name: target3
    host: target3.com
    sSLInfo:
      clientAuthEnabled: true
      keyStore: target3-keystore
      trustStore: target3-truststore
      keyAlias: target3-key

Products

Product are defined on the organization level

Deploy products: products

apigee-apim products products.yaml --org <org>

List all products in organization: listAPIProducts

apigee-apim listAPIProducts --org <org>

Key Value Maps (KVMs)

KVMs can be deployed on the organization and environment level.

:warning: If you are using Hybrid/X: It is no longer possible to add entries to KVMs outside of the message processor. Meaning that a KVM Admin Proxy has to be implemented to add values to a KVM.

Deploy Key Value Map: kvms

apigee-apim kvms kvms.yaml --org <org> --env test 

KVM configuration:

kvms:
  test1:
    key2: "{environmentvariable}"
    key3: "{environmentvariable2}"
    key4: "plain-variable"

Encrypted KVM configuration:

kvms:
  test1:
    encrypted: true
    key2: "{environmentvariable}"
    key3: "{environmentvariable2}"
    key4: "plain-variable"

Target Servers

Deploy Target Servers: targetservers

apigee-apim targetservers targetServers.yaml --org <org> --env test

targetServers.yaml

targetServers:
  - name: google
    host: google2.com
  - name: google1
    host: google1.com
    port: 8080
  - name: google2
    host: google2.com
    sSLInfo:
      clientAuthEnabled: true
      keyStore: google-keystore
      trustStore: google-truststore
      keyAlias: google-key

Caches

Deploy caches: caches

apigee-apim caches caches.yaml --org <org> --env test

caches.yaml

caches:
  - name: cache-1
    description: cache-1
    expirySettings:
        valuesNull: true/false
    timeoutInSec: {sec}
    timeOfDay: {hh:mm:ss:}
    expiryDate: {mm-dd-yyy}
    overflowToDisk: true/false
    skipCacheIfElementSizeInKBExceeds: {num_elements}

Resource files

Deploy resource files: resourcefiles

apigee-apim resourcefiles resourcefiles.yaml --org <org> --env test

resourcefiles.yaml

resourcefiles:
  test:
    type: "properties"
    filename: "test.properties"

Proxies

Call this from the directory above 'apiproxy' or specify a different directory using --directory -d

Deploying a proxy: deploy

apigee-apim deploy -n <apiName> --org <org> --env <env>

Deploying an existing revision: deployExistingRevision

apigee-apim deployExistingRevision -n <apiName> -r <rev> --org <org> --env <env>

List currently deployed revision: listDeployedRevision

apigee-apim listDeployedRevision -n <apiName> --org <org> --env <env>

Spec API

This functionality is in alpha release and is only available for orgs that have this enabled.

apigee-apim deploySpec -s <spec> -a <apiproduct> -p <portal> --org <org> --env <env>

Developer Apps

Custom attributes

Call this from command line when globally installed to upsert a custom attribute

 apigee-apim updateCustomAttribute --org <org> --dev <developer> --app <appName> --attributeName <attributeName> --attributeValue <attributeValue>
0.1.34

20 days ago

0.1.35

20 days ago

0.1.33

8 months ago

0.1.32

1 year ago

0.1.30

2 years ago

0.1.31

2 years ago

0.1.29

2 years ago

0.1.27

2 years ago

0.1.28

2 years ago

0.1.26

2 years ago

0.1.22

3 years ago

0.1.23

3 years ago

0.1.24

3 years ago

0.1.25

3 years ago

0.1.21

3 years ago

0.1.20

3 years ago

0.1.19

3 years ago

0.1.18

3 years ago

0.1.17

3 years ago

0.1.16

3 years ago

0.1.15

3 years ago

0.1.14

3 years ago

0.1.13

3 years ago

0.1.12

3 years ago

0.1.10

3 years ago

0.1.11

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.4

3 years ago

0.1.5

3 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.0.8

4 years ago

0.0.5

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago