mashery-client
v1.0.0
Published
Client for interacting with the Mashery V3 REST API.
Downloads
32
Readme
Mashery REST API Client
Node.js client for the Mashery REST API (v3).
Getting Started
Install the module with npm install mashery-client -g
var mashery = require('mashery');
// initialize the API client
var api = mashery.init({
user: '<user_id>',
pass: '<user_pass>',
key: '<api_key>',
secret: '<api_secret>',
areaUuid: '<area_uuid>'
});
// note authentication will be automatically handled for you
// list all services
apiClient.methods.fetchAllServices({}, function(serviceData, serviceRawResponse){
console.log(JSON.stringify(serviceData, null, 4));
});
// add an endpoint to an existing service
var args = {
path: { serviceId: '<service_id>' },
data: {<JSON_object_representing_endpoint>}
};
apiClient.methods.createServiceEndpoint(args, function(epData, epRawResponse){
console.log(JSON.stringify(epData, null, 4));
});
Supported Methods
Services
| Method | Args | | ------ | ---- | | fetchAllServices | | | fetchService | id | | createService | | | updateService | id | | deleteService | id |
Endpoints
| Method | Args | | ------ | ---- | | fetchAllServiceEndpoints | id | | fetchServiceEndpoint | serviceId, id | | createServiceEndpoint | serviceId | | updateServiceEndpoint | serviceId, id | | deleteServiceEndpoint | serviceId, id |
Methods
| Method | Args | | ------ | ---- | | fetchAllEndpointMethods | serviceId, endpointId | | fetchEndpointMethod | serviceId, endpointId, id | | createEndpointMethod | serviceId, endpointId | | updateEndpointMethod | serviceId, endpointId, id | | deleteEndpointMethod | serviceId, endpointId, id |
Service Cache
| Method | Args | | ------ | ---- | | fetchSecurityProfile | serviceId | | createSecurityProfile | | | updateSecurityProfile | serviceId | | deleteSecurityProfile | serviceId |
Service Error Sets
Service Error Set Documentation
| Method | Args | | ------ | ---- | | fetchAllServiceErrorSets | id | | fetchServiceErrorSet | serviceId, id | | createServiceErrorSet | serviceId | | updateServiceErrorSet | serviceId, id | | deleteServiceErrorSet | serviceId, id |
Service Error Set Messages
Service Error Set Documentation
| Method | Args | | ------ | ---- | | fetchAllErrorMessages | serviceId, errorSetId | | fetchErrorMessage | serviceId, errorSetId, id | | createErrorMessage | serviceId, errorSetId | | updateErrorMessage | serviceId, errorSetId, id | | deleteErrorMessage | serviceId, errorSetId, id |
Endpoint Cache
| Method | Args | | ------ | ---- | | fetchEndpointCache | serviceId, endpointId | | createEndpointCache | serviceId, endpointId | | updateEndpointCache | serviceId, endpointId | | deleteEndpointCache | serviceId, endpointId |
Security Profile
Security Profile Documentation
| Method | Args | | ------ | ---- | | fetchSecurityProfile | serviceId | | createSecurityProfile | | | updateSecurityProfile | serviceId | | deleteSecurityProfile | serviceId |
Security Profile - OAuth
Security Profile Documentation
| Method | Args | | ------ | ---- | | fetchSecurityProfileOAuth | serviceId | | createSecurityProfileOAuth | | | updateSecurityProfileOAuth | serviceId | | deleteSecurityProfileOAuth | serviceId |
Response Filters
| Method | Args | | ------ | ---- | | fetchAllResponseFilters | serviceId, endpointId, methodId | | fetchResponseFilter | serviceId, endpointId, methodId, id | | createResponseFilter | serviceId, endpointId, methodId | | updateResponseFilter | serviceId, endpointId, methodId, id | | deleteResponseFilter | serviceId, endpointId, methodId, id |
Scheduled Maintenance Event
Scheduled Maintenance Documentation
| Method | Args | | ------ | ---- | | fetchScheduledEvent | serviceId, endpointId | | createScheduledEvent | serviceId, endpointId | | updateScheduledEvent | serviceId, endpointId | | deleteScheduledEvent | serviceId, endpointId |
CORS
| Method | Args | | ------ | ---- | | fetchCORS | serviceId, endpointId | | createCORS | serviceId, endpointId | | updateCORS | serviceId, endpointId | | deleteCORS | serviceId, endpointId |
System Domain Authentication
| Method | Args | | ------ | ---- | | fetchSysAuth | serviceId, endpointId | | createSysAuth | serviceId, endpointId | | updateSysAuth | serviceId, endpointId | | deleteSysAuth | serviceId, endpointId |
Service Roles
| Method | Args | | ------ | ---- | | fetchAllServiceRoles | id | | fetchServiceRole | serviceId, id | | createServiceRole | serviceId | | updateServiceRole | serviceId, id | | deleteServiceRole | serviceId, id |
Packages
| Method | Args | | ------ | ---- | | fetchAllPackages | | | fetchPackage | id | | createPackage | | | updatePackage | id | | deletePackage | id |
Package Keys
| Method | Args | | ------ | ---- | | fetchAllPackageKeys | | | fetchPackageKey | id | | updatePackageKey | id | | deletePackageKey | id |
Plans
| Method | Args | | ------ | ---- | | fetchAllPlans | packageId | | fetchPlan | packageId, id | | createPlan | packageId |
Plan Services
| Method | Args | | ------ | ---- | | fetchAllPlanServices | packageId, planId | | fetchAllPlanServicesForService | packageId, planId, id | | createPlanService | packageId, planId| | createPlanEndpoint | packageId, planId, serviceId | | createPlanMethod | packageId, planId, serviceId, endpointId |
Domains
| Method | Args | Documentation | | ------ | ---- | ---| | fetchAllDomains | | Domains | | fetchDomain | | | createDomain | | | | | | | fetchPublicDomains | | Public Domains | | | | | | fetchPublicDomainFQDNs | | FQDN | | | | | | fetchSystemDomains | | System Domain |
Roles
| Method | Args | | ------ | ---- | | fetchAllRoles | |
Scheduled Maintenance Events
Scheduled Maintenance Documentation
| Method | Args | | ------ | ---- | | fetchAllScheduledMaintenance | | | fetchScheduledMaintenance | id | | createScheduledMaintenance | | | updateScheduledMaintenance | id | | deleteScheduledMaintenance | id |
Scheduled Maintenance Event Endpoints
Scheduled Maintenance Endpoint Documentation
| Method | Args | | ------ | ---- | | fetchAllScheduledMaintenanceEndpoints | maintenanceId | | fetchScheduledMaintenanceEndpoint | maintenanceId, id | | createScheduledMaintenanceEndpoint | maintenanceId | | updateScheduledMaintenanceEndpoint | maintenanceId, id | | deleteScheduledMaintenanceEndpoint | maintenanceId, id |
Email Template Sets
Email Template Set Documentation
| Method | Args | | ------ | ---- | | fetchAllEmailTemplateSets | | | fetchEmailTemplateSet | id | | createEmailTemplateSet | | | updateEmailTemplateSet | id | | deleteEmailTemplateSet | id |
Email Templates
| Method | Args | | ------ | ---- | | fetchAllEmailTemplates | emailSetId | | fetchEmailTemplate | emailSetId, id | | createEmailTemplate | emailSetId | | updateEmailTemplate | emailSetId, id | | deleteEmailTemplate | emailSetId, id |
##Authors
Brian Antonelli
- http://github.com/brianantonelli
Copyright and license
Copyright (c) 2016 Cox Automotive
Licensed under the MIT License (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the COPYING file.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.