Code Monkey home page Code Monkey logo

perl-apigee-edge's Introduction

Build Status Coverage Status Gitter chat

NAME

Apigee::Edge - Apigee.com 'Edge' management API.

SYNOPSIS

use Apigee::Edge;

my $apigee = Apigee::Edge->new(
  org => 'apigee_org',
  usr => 'your_email',
  pwd => 'your_password'
);

DESCRIPTION

Apigee::Edge is an object-oriented interface to facilitate management of Developers and Apps using the Apigee.com 'Edge' management API. see http://apigee.com/docs/api-services/content/api-reference-getting-started

The API is incompleted. welcome to fork the repos on github https://github.com/binary-com/perl-Apigee-Edge and send us pull-requests.

METHODS

new

Apps

http://apigee.com/docs/api/apps-0

get_app

my $app = $apigee->get_app($app_id);

get_apps

my $app_ids = $apigee->get_apps();
my $apps = $apigee->get_apps(expand => 'true', includeCred => 'true');

get_apps_by_family

my $app_ids = $apigee->get_apps_by_family($family);

get_apps_by_keystatus

my $app_ids = $apigee->get_apps_by_keystatus($keystatus);

get_apps_by_type

my $app_ids = $apigee->get_apps_by_type($type);

Developers

http://apigee.com/docs/api/developers-0

get_developers

my $developers = $apigee->get_developers();

get_app_developers

my $developers = $apigee->get_app_developers($app_name);

get_developer

my $developer = $apigee->get_developer('[email protected]') or die $apigee->errstr;

create_developer

my $developer = $apigee->create_developer(
    "email" => '[email protected]',
    "firstName" => "Fayland",
    "lastName" => "Lam",
    "userName" => "fayland.binary",
    "attributes" => [
        {
            "name" => "Attr1",
            "value" => "V1"
        },
        {
            "name" => "A2",
            "value" => "V2.v2"
        }
    ]
);

update_developer

my $developer = $apigee->update_developer(
    $developer_email,
    {
        "firstName" => "Fayland",
        "lastName" => "Lam",
    }
);

delete_developer

my $developer = $apigee->delete_developer('[email protected]') or die $apigee->errstr;

set_developer_status

my $status = $apigee->set_developer_status($email, $status);

Apps: Developer

http://apigee.com/docs/api/apps-developer

change_app_status

my $app = $apigee->change_app_status($developer_email, $app_name);

create_developer_app

my $app = $apigee->create_developer_app(
    $developer_email,
    {
        "name" => "Test App",
        "apiProducts" => [ "{apiproduct1}", "{apiproduct2}", ...],
        "keyExpiresIn" => "{milliseconds}",
        "attributes" => [
            {
                "name" => "DisplayName",
                "value" => "{display_name_value}"
            },
            {
                "name" => "Notes",
                "value" => "{notes_for_developer_app}"
            },
            {
                "name" => "{custom_attribute_name}",
                "value" => "{custom_attribute_value}"
            }
        ],
        "callbackUrl" => "{url}",
    }
);

delete_developer_app

my $app = $apigee->delete_developer_app($developer_email, $app_name);

get_developer_app

my $app = $apigee->get_developer_app($developer_email, $app_name);

get_developer_apps

my $apps = $apigee->get_developer_apps($developer_email);
my $apps = $apigee->get_developer_apps($developer_email, { expand => 'true' });

update_developer_app

my $app = $apigee->update_developer_app($developer_email, $app_name, {
    # update part
});

regenerate_developer_app_key

my $app = $apigee->regenerate_developer_app_key($developer_email, $app_name, {
    # update part
});

get_count_of_developer_app_resource

my $count = $apigee->get_count_of_developer_app_resource($developer_email, $app_name, $entity_name);

API Products

http://apigee.com/docs/api/api-products-1

get_api_products

my $products = $apigee->get_api_products();
my $products = $apigee->get_api_products(expand => 'true');

search_api_products

my $products = $apigee->search_api_products('attributename' => 'access', 'attributevalue' => 'public');
my $products = $apigee->search_api_products('attributename' => 'access', 'attributevalue' => 'private', expand => 'true');

get_api_product

my $product = $apigee->get_api_product($product_name);

get_api_product_details

my $apps = $apigee->get_api_product_details(
    $product_name,
    query => 'list', entity => 'apps' # or query => 'count', entity => 'keys, apps, developers, or companies'
);

delete_api_product

my $product = $apigee->delete_api_product($product_name);

create_api_product

my $product = $apigee->create_api_product(
    "approvalType" => "manual",
    "attributes" => [
        {
          "name" => "access",
          "value" => "private"
        },
        {
          "name" => "ATTR2",
          "value" => "V2"
        }
    ],
    "description" => "DESC",
    "displayName" => "TEST PRODUCT NAME",
    "name"  => "test-product-name",
    "apiResources" => [ "/resource1", "/resource2"],
    "environments" => [ "test", "prod"],
    # "proxies" => ["{proxy1}", "{proxy2}", ...],
    # "quota" => "{quota}",
    # "quotaInterval" => "{quota_interval}",
    # "quotaTimeUnit" => "{quota_unit}",
    "scopes" => ["user", "repos"]
);

update_api_product

my $product = $apigee->update_api_product(
    "test-product-name",
    {
        "approvalType" => "auto",
        "displayName" => "ANOTHER TEST PRODUCT NAME",
    }
);

request

The underlaying method to call Apigee when you see something is missing.

$self->request('GET', "/o/$org_name/apps/$app_id");
$self->request('DELETE', "/o/$org_name/developers/" . uri_escape($email));
$self->request('POST', "/o/$org_name/developers", %args);
$self->request('PUT', "/o/$org_name/developers/" . uri_escape($email), %args);

GITHUB

https://github.com/binary-com/perl-Apigee-Edge

AUTHOR

Binary.com [email protected]

COPYRIGHT

Copyright 2014- Binary.com

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

perl-apigee-edge's People

Contributors

fayland avatar jy-binary avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.