Class: PlatformAPI::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/platform-api/client.rb

Overview

The platform API empowers developers to automate, extend and combine Heroku with other services.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Client

Returns a new instance of Client.


96
97
98
# File 'lib/platform-api/client.rb', line 96

def initialize(client)
  @client = client
end

Instance Method Details

#accountAccount

An account represents an individual signed up to use the Heroku platform.

Returns:


110
111
112
# File 'lib/platform-api/client.rb', line 110

def 
  @account_resource ||= Account.new(@client)
end

#account_featureAccountFeature

An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku.

Returns:


103
104
105
# File 'lib/platform-api/client.rb', line 103

def 
  @account_feature_resource ||= AccountFeature.new(@client)
end

#addonAddon

Add-ons represent add-ons that have been provisioned and attached to one or more apps.

Returns:


159
160
161
# File 'lib/platform-api/client.rb', line 159

def addon
  @addon_resource ||= Addon.new(@client)
end

#addon_actionAddonAction

Add-on Actions are lifecycle operations for add-on provisioning and deprovisioning. They allow whitelisted add-on providers to (de)provision add-ons in the background and then report back when (de)provisioning is complete.

Returns:


117
118
119
# File 'lib/platform-api/client.rb', line 117

def addon_action
  @addon_action_resource ||= AddonAction.new(@client)
end

#addon_attachmentAddonAttachment

An add-on attachment represents a connection between an app and an add-on that it has been given access to.

Returns:


124
125
126
# File 'lib/platform-api/client.rb', line 124

def addon_attachment
  @addon_attachment_resource ||= AddonAttachment.new(@client)
end

#addon_configAddonConfig

Configuration of an Add-on

Returns:


131
132
133
# File 'lib/platform-api/client.rb', line 131

def addon_config
  @addon_config_resource ||= AddonConfig.new(@client)
end

#addon_plan_actionAddonPlanAction

Add-on Plan Actions are Provider functionality for specific add-on installations

Returns:


138
139
140
# File 'lib/platform-api/client.rb', line 138

def addon_plan_action
  @addon_plan_action_resource ||= AddonPlanAction.new(@client)
end

#addon_region_capabilityAddonRegionCapability

Add-on region capabilities represent the relationship between an Add-on Service and a specific Region. Only Beta and GA add-ons are returned by these endpoints.


145
146
147
# File 'lib/platform-api/client.rb', line 145

def addon_region_capability
  @addon_region_capability_resource ||= AddonRegionCapability.new(@client)
end

#addon_serviceAddonService

Add-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication.

Returns:


152
153
154
# File 'lib/platform-api/client.rb', line 152

def addon_service
  @addon_service_resource ||= AddonService.new(@client)
end

#appApp

An app represents the program that you would like to deploy and run on Heroku.

Returns:


194
195
196
# File 'lib/platform-api/client.rb', line 194

def app
  @app_resource ||= App.new(@client)
end

#app_featureAppFeature

An app feature represents a Heroku labs capability that can be enabled or disabled for an app on Heroku.

Returns:


166
167
168
# File 'lib/platform-api/client.rb', line 166

def app_feature
  @app_feature_resource ||= AppFeature.new(@client)
end

#app_formation_setAppFormationSet

App formation set describes the combination of process types with their quantities and sizes as well as application process tier

Returns:


173
174
175
# File 'lib/platform-api/client.rb', line 173

def app_formation_set
  @app_formation_set_resource ||= AppFormationSet.new(@client)
end

#app_setupAppSetup

An app setup represents an app on Heroku that is setup using an environment, addons, and scripts described in an app.json manifest file.

Returns:


180
181
182
# File 'lib/platform-api/client.rb', line 180

def app_setup
  @app_setup_resource ||= AppSetup.new(@client)
end

#app_transferAppTransfer

An app transfer represents a two party interaction for transferring ownership of an app.

Returns:


187
188
189
# File 'lib/platform-api/client.rb', line 187

def app_transfer
  @app_transfer_resource ||= AppTransfer.new(@client)
end

#buildBuild

A build represents the process of transforming a code tarball into a slug

Returns:


208
209
210
# File 'lib/platform-api/client.rb', line 208

def build
  @build_resource ||= Build.new(@client)
end

#build_resultBuildResult

A build result contains the output from a build.

Returns:


201
202
203
# File 'lib/platform-api/client.rb', line 201

def build_result
  @build_result_resource ||= BuildResult.new(@client)
end

#buildpack_installationBuildpackInstallation

A buildpack installation represents a buildpack that will be run against an app.


215
216
217
# File 'lib/platform-api/client.rb', line 215

def buildpack_installation
  @buildpack_installation_resource ||= BuildpackInstallation.new(@client)
end

#collaboratorCollaborator

A collaborator represents an account that has been given access to an app on Heroku.

Returns:


222
223
224
# File 'lib/platform-api/client.rb', line 222

def collaborator
  @collaborator_resource ||= Collaborator.new(@client)
end

#config_varConfigVar

Config Vars allow you to manage the configuration information provided to an app on Heroku.

Returns:


229
230
231
# File 'lib/platform-api/client.rb', line 229

def config_var
  @config_var_resource ||= ConfigVar.new(@client)
end

#creditCredit

A credit represents value that will be used up before further charges are assigned to an account.

Returns:


236
237
238
# File 'lib/platform-api/client.rb', line 236

def credit
  @credit_resource ||= Credit.new(@client)
end

#domainDomain

Domains define what web routes should be routed to an app on Heroku.

Returns:


243
244
245
# File 'lib/platform-api/client.rb', line 243

def domain
  @domain_resource ||= Domain.new(@client)
end

#dynoDyno

Dynos encapsulate running processes of an app on Heroku. Detailed information about dyno sizes can be found at: https://devcenter.heroku.com/articles/dyno-types.

Returns:


257
258
259
# File 'lib/platform-api/client.rb', line 257

def dyno
  @dyno_resource ||= Dyno.new(@client)
end

#dyno_sizeDynoSize

Dyno sizes are the values and details of sizes that can be assigned to dynos. This information can also be found at : https://devcenter.heroku.com/articles/dyno-types.

Returns:


250
251
252
# File 'lib/platform-api/client.rb', line 250

def dyno_size
  @dyno_size_resource ||= DynoSize.new(@client)
end

#eventEvent

An event represents an action performed on another API resource.

Returns:


264
265
266
# File 'lib/platform-api/client.rb', line 264

def event
  @event_resource ||= Event.new(@client)
end

#failed_eventFailedEvent

A failed event represents a failure of an action performed on another API resource.

Returns:


271
272
273
# File 'lib/platform-api/client.rb', line 271

def failed_event
  @failed_event_resource ||= FailedEvent.new(@client)
end

#filter_appsFilterApps

Filters are special endpoints to allow for API consumers to specify a subset of resources to consume in order to reduce the number of requests that are performed. Each filter endpoint endpoint is responsible for determining its supported request format. The endpoints are over POST in order to handle large request bodies without hitting request uri query length limitations, but the requests themselves are idempotent and will not have side effects.

Returns:


278
279
280
# File 'lib/platform-api/client.rb', line 278

def filter_apps
  @filter_apps_resource ||= FilterApps.new(@client)
end

#formationFormation

The formation of processes that should be maintained for an app. Update the formation to scale processes or change dyno sizes. Available process type names and commands are defined by the process_types attribute for the slug currently released on an app.

Returns:


285
286
287
# File 'lib/platform-api/client.rb', line 285

def formation
  @formation_resource ||= Formation.new(@client)
end

#identity_providerIdentityProvider

Identity Providers represent the SAML configuration of an Organization.

Returns:


292
293
294
# File 'lib/platform-api/client.rb', line 292

def identity_provider
  @identity_provider_resource ||= IdentityProvider.new(@client)
end

#inbound_rulesetInboundRuleset

An inbound-ruleset is a collection of rules that specify what hosts can or cannot connect to an application.

Returns:


299
300
301
# File 'lib/platform-api/client.rb', line 299

def inbound_ruleset
  @inbound_ruleset_resource ||= InboundRuleset.new(@client)
end

#invitationInvitation

An invitation represents an invite sent to a user to use the Heroku platform.

Returns:


306
307
308
# File 'lib/platform-api/client.rb', line 306

def invitation
  @invitation_resource ||= Invitation.new(@client)
end

#invoiceInvoice

An invoice is an itemized bill of goods for an account which includes pricing and charges.

Returns:


320
321
322
# File 'lib/platform-api/client.rb', line 320

def invoice
  @invoice_resource ||= Invoice.new(@client)
end

#invoice_addressInvoiceAddress

An invoice address represents the address that should be listed on an invoice.

Returns:


313
314
315
# File 'lib/platform-api/client.rb', line 313

def invoice_address
  @invoice_address_resource ||= InvoiceAddress.new(@client)
end

#keyKey

Keys represent public SSH keys associated with an account and are used to authorize accounts as they are performing git operations.

Returns:


327
328
329
# File 'lib/platform-api/client.rb', line 327

def key
  @key_resource ||= Key.new(@client)
end

#log_drainLogDrain

Log drains provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some add-ons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on.

Returns:


334
335
336
# File 'lib/platform-api/client.rb', line 334

def log_drain
  @log_drain_resource ||= LogDrain.new(@client)
end

#log_sessionLogSession

A log session is a reference to the http based log stream for an app.

Returns:


341
342
343
# File 'lib/platform-api/client.rb', line 341

def log_session
  @log_session_resource ||= LogSession.new(@client)
end

#oauth_authorizationOauthAuthorization

OAuth authorizations represent clients that a Heroku user has authorized to automate, customize or extend their usage of the platform. For more information please refer to the Heroku OAuth documentation

Returns:


348
349
350
# File 'lib/platform-api/client.rb', line 348

def oauth_authorization
  @oauth_authorization_resource ||= OauthAuthorization.new(@client)
end

#oauth_clientOauthClient

OAuth clients are applications that Heroku users can authorize to automate, customize or extend their usage of the platform. For more information please refer to the Heroku OAuth documentation.

Returns:


355
356
357
# File 'lib/platform-api/client.rb', line 355

def oauth_client
  @oauth_client_resource ||= OauthClient.new(@client)
end

#oauth_grantOauthGrant

OAuth grants are used to obtain authorizations on behalf of a user. For more information please refer to the Heroku OAuth documentation

Returns:


362
363
364
# File 'lib/platform-api/client.rb', line 362

def oauth_grant
  @oauth_grant_resource ||= OauthGrant.new(@client)
end

#oauth_tokenOauthToken

OAuth tokens provide access for authorized clients to act on behalf of a Heroku user to automate, customize or extend their usage of the platform. For more information please refer to the Heroku OAuth documentation

Returns:


369
370
371
# File 'lib/platform-api/client.rb', line 369

def oauth_token
  @oauth_token_resource ||= OauthToken.new(@client)
end

#organizationOrganization

Organizations allow you to manage access to a shared group of applications across your development team.

Returns:


432
433
434
# File 'lib/platform-api/client.rb', line 432

def organization
  @organization_resource ||= Organization.new(@client)
end

#organization_addonOrganizationAddon

A list of add-ons the Organization uses across all apps

Returns:


376
377
378
# File 'lib/platform-api/client.rb', line 376

def organization_addon
  @organization_addon_resource ||= OrganizationAddon.new(@client)
end

#organization_appOrganizationApp

An organization app encapsulates the organization specific functionality of Heroku apps.

Returns:


390
391
392
# File 'lib/platform-api/client.rb', line 390

def organization_app
  @organization_app_resource ||= OrganizationApp.new(@client)
end

#organization_app_collaboratorOrganizationAppCollaborator

An organization collaborator represents an account that has been given access to an organization app on Heroku.


383
384
385
# File 'lib/platform-api/client.rb', line 383

def organization_app_collaborator
  @organization_app_collaborator_resource ||= OrganizationAppCollaborator.new(@client)
end

#organization_app_permissionOrganizationAppPermission

An organization app permission is a behavior that is assigned to a user in an organization app.


453
454
455
# File 'lib/platform-api/client.rb', line 453

def organization_app_permission
  @organization_app_permission_resource ||= OrganizationAppPermission.new(@client)
end

#organization_featureOrganizationFeature

An organization feature represents a feature enabled on an organization account.

Returns:


397
398
399
# File 'lib/platform-api/client.rb', line 397

def organization_feature
  @organization_feature_resource ||= OrganizationFeature.new(@client)
end

#organization_invitationOrganizationInvitation

An organization invitation represents an invite to an organization.


404
405
406
# File 'lib/platform-api/client.rb', line 404

def organization_invitation
  @organization_invitation_resource ||= OrganizationInvitation.new(@client)
end

#organization_invoiceOrganizationInvoice

An organization invoice is an itemized bill of goods for an organization which includes pricing and charges.

Returns:


411
412
413
# File 'lib/platform-api/client.rb', line 411

def organization_invoice
  @organization_invoice_resource ||= OrganizationInvoice.new(@client)
end

#organization_memberOrganizationMember

An organization member is an individual with access to an organization.

Returns:


418
419
420
# File 'lib/platform-api/client.rb', line 418

def organization_member
  @organization_member_resource ||= OrganizationMember.new(@client)
end

#organization_preferencesOrganizationPreferences

Tracks an organization's preferences


425
426
427
# File 'lib/platform-api/client.rb', line 425

def organization_preferences
  @organization_preferences_resource ||= OrganizationPreferences.new(@client)
end

#outbound_rulesetOutboundRuleset

An outbound-ruleset is a collection of rules that specify what hosts Dynos are allowed to communicate with.

Returns:


439
440
441
# File 'lib/platform-api/client.rb', line 439

def outbound_ruleset
  @outbound_ruleset_resource ||= OutboundRuleset.new(@client)
end

#password_resetPasswordReset

A password reset represents a in-process password reset attempt.

Returns:


446
447
448
# File 'lib/platform-api/client.rb', line 446

def password_reset
  @password_reset_resource ||= PasswordReset.new(@client)
end

#pipelinePipeline

A pipeline allows grouping of apps into different stages.

Returns:


481
482
483
# File 'lib/platform-api/client.rb', line 481

def pipeline
  @pipeline_resource ||= Pipeline.new(@client)
end

#pipeline_couplingPipelineCoupling

Information about an app's coupling to a pipeline

Returns:


460
461
462
# File 'lib/platform-api/client.rb', line 460

def pipeline_coupling
  @pipeline_coupling_resource ||= PipelineCoupling.new(@client)
end

#pipeline_promotionPipelinePromotion

Promotions allow you to move code from an app in a pipeline to all targets

Returns:


474
475
476
# File 'lib/platform-api/client.rb', line 474

def pipeline_promotion
  @pipeline_promotion_resource ||= PipelinePromotion.new(@client)
end

#pipeline_promotion_targetPipelinePromotionTarget

Promotion targets represent an individual app being promoted to


467
468
469
# File 'lib/platform-api/client.rb', line 467

def pipeline_promotion_target
  @pipeline_promotion_target_resource ||= PipelinePromotionTarget.new(@client)
end

#planPlan

Plans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication.

Returns:


488
489
490
# File 'lib/platform-api/client.rb', line 488

def plan
  @plan_resource ||= Plan.new(@client)
end

#rate_limitRateLimit

Rate Limit represents the number of request tokens each account holds. Requests to this endpoint do not count towards the rate limit.

Returns:


495
496
497
# File 'lib/platform-api/client.rb', line 495

def rate_limit
  @rate_limit_resource ||= RateLimit.new(@client)
end

#regionRegion

A region represents a geographic location in which your application may run.

Returns:


502
503
504
# File 'lib/platform-api/client.rb', line 502

def region
  @region_resource ||= Region.new(@client)
end

#releaseRelease

A release represents a combination of code, config vars and add-ons for an app on Heroku.

Returns:


509
510
511
# File 'lib/platform-api/client.rb', line 509

def release
  @release_resource ||= Release.new(@client)
end

#slugSlug

A slug is a snapshot of your application code that is ready to run on the platform.

Returns:


516
517
518
# File 'lib/platform-api/client.rb', line 516

def slug
  @slug_resource ||= Slug.new(@client)
end

#sms_numberSmsNumber

SMS numbers are used for recovery on accounts with two-factor authentication enabled.

Returns:


523
524
525
# File 'lib/platform-api/client.rb', line 523

def sms_number
  @sms_number_resource ||= SmsNumber.new(@client)
end

#sni_endpointSniEndpoint

SNI Endpoint is a public address serving a custom SSL cert for HTTPS traffic, using the SNI TLS extension, to a Heroku app.

Returns:


530
531
532
# File 'lib/platform-api/client.rb', line 530

def sni_endpoint
  @sni_endpoint_resource ||= SniEndpoint.new(@client)
end

#sourceSource

A source is a location for uploading and downloading an application's source code.

Returns:


537
538
539
# File 'lib/platform-api/client.rb', line 537

def source
  @source_resource ||= Source.new(@client)
end

#spaceSpace

A space is an isolated, highly available, secure app execution environments, running in the modern VPC substrate.

Returns:


558
559
560
# File 'lib/platform-api/client.rb', line 558

def space
  @space_resource ||= Space.new(@client)
end

#space_app_accessSpaceAppAccess

Space access represents the permissions a particular user has on a particular space.

Returns:


544
545
546
# File 'lib/platform-api/client.rb', line 544

def space_app_access
  @space_app_access_resource ||= SpaceAppAccess.new(@client)
end

#space_natSpaceNat

Network address translation (NAT) for stable outbound IP addresses from a space

Returns:


551
552
553
# File 'lib/platform-api/client.rb', line 551

def space_nat
  @space_nat_resource ||= SpaceNat.new(@client)
end

#ssl_endpointSSLEndpoint

SSL Endpoint is a public address serving custom SSL cert for HTTPS traffic to a Heroku app. Note that an app must have the ssl:endpoint add-on installed before it can provision an SSL Endpoint using these APIs.

Returns:


565
566
567
# File 'lib/platform-api/client.rb', line 565

def ssl_endpoint
  @ssl_endpoint_resource ||= SSLEndpoint.new(@client)
end

#stackStack

Stacks are the different application execution environments available in the Heroku platform.

Returns:


572
573
574
# File 'lib/platform-api/client.rb', line 572

def stack
  @stack_resource ||= Stack.new(@client)
end

#user_preferencesUserPreferences

Tracks a user's preferences and message dismissals

Returns:


579
580
581
# File 'lib/platform-api/client.rb', line 579

def user_preferences
  @user_preferences_resource ||= UserPreferences.new(@client)
end

#whitelisted_addon_serviceWhitelistedAddonService

Entities that have been whitelisted to be used by an Organization


586
587
588
# File 'lib/platform-api/client.rb', line 586

def whitelisted_addon_service
  @whitelisted_addon_service_resource ||= WhitelistedAddonService.new(@client)
end