View source on GitHub |
Capability service stub.
Inherits From: APIProxyStub
, expected_type
google.appengine.api.capabilities.capability_stub.CapabilityServiceStub(
service_name='capability_service'
)
Args | |
---|---|
service_name
|
Service name expected for all calls. |
Methods
Clear
Clear()
CreateRPC
CreateRPC()
Creates RPC object instance.
Returns | |
---|---|
An instance of RPC. |
MakeSyncCall
MakeSyncCall(
service, call, request, response, request_id=None
)
The main RPC entry point.
Args | |
---|---|
service
|
Must be name as provided to service_name of constructor.
|
call
|
A string representing the rpc to make. Must be part of
the underlying services methods and impemented by _Dynamic_<call> .
|
request
|
A protocol buffer of the type corresponding to call .
|
response
|
A protocol buffer of the type corresponding to call .
|
request_id
|
A unique string identifying the request associated with the API call. |
SetCapabilityStatus
SetCapabilityStatus(
package, capability, status
)
Set the status of an individual capability.
This method is thread-unsafe, so should only be called during set-up, before multiple API server threads start.
Args | |
---|---|
package
|
String name of package containing the capability. |
capability
|
String capability name. |
status
|
The CapabilityConfig status enum to set. |
Raises | |
---|---|
KeyError
|
When an unsupported package or capability is requested. |
SetError
SetError(
error, method=None, error_rate=1
)
Set an error condition that may be raised when calls made to stub.
If a method is specified, the error will only apply to that call. The error rate is applied to the method specified or all calls if method is not set.
Args | |
---|---|
error
|
An instance of apiproxy_errors.Error or None for no error.
|
method
|
A string representing the method that the error will affect. |
error_rate
|
a number from [0, 1] that sets the chance of the error,
defaults to 1 .
|
SetPackageEnabled
SetPackageEnabled(
package, enabled
)
Set all features of a given package to enabled.
This method is thread-unsafe, so should only be called during set-up, before multiple API server threads start.
Args | |
---|---|
package
|
Name of package. |
enabled
|
True to enable, False to disable. |
Raises | |
---|---|
KeyError
|
When an unsupported package is requested. |
Class Variables | |
---|---|
THREADSAFE |
True
|