com.baidubce.services.cfc.model
Class CreateFunctionRequest

java.lang.Object
  extended by com.baidubce.model.AbstractBceRequest
      extended by com.baidubce.services.cfc.model.GenericFunctionRequest
          extended by com.baidubce.services.cfc.model.CreateFunctionRequest

public class CreateFunctionRequest
extends GenericFunctionRequest

Request object for creating a Baidu CFC function


Constructor Summary
CreateFunctionRequest(String functionName, String description)
           
 
Method Summary
 Code getCode()
          Get the function code
 Environment getEnvironment()
          Get the function environment
 String getHandler()
          Get the entry function of CFC call.
 Integer getMemorySize()
          Get the memory siz.
 String getRuntime()
          Get the runtime for function.
 Integer getTimeout()
          Get the timeout for executing a function
 void setCode(Code code)
          Set the function code
 void setEnvironment(Environment environment)
          Set the function environment
 void setHandler(String handler)
          Set the entry function of CFC call.
 void setMemorySize(Integer memorySize)
          Set the memory size.
 void setRuntime(String runtime)
          Set the runtime for function.
 void setTimeout(Integer timeout)
          Set the timeout for executing a function.
 String toString()
          (non-Javadoc)
 CreateFunctionRequest withCode(Code code)
           
 CreateFunctionRequest withDescription(String description)
           
 CreateFunctionRequest withEnvironment(Environment environment)
           
 CreateFunctionRequest withFunctionName(String functionName)
           
 CreateFunctionRequest withHandler(String handler)
           
 CreateFunctionRequest withMemorySize(Integer memorySize)
           
 CreateFunctionRequest withRequestCredentials(BceCredentials credentials)
           
 CreateFunctionRequest withRuntime(String runtime)
           
 CreateFunctionRequest withTimeout(Integer timeout)
           
 
Methods inherited from class com.baidubce.services.cfc.model.GenericFunctionRequest
getDescription, getFunctionName, setDescription, setFunctionName
 
Methods inherited from class com.baidubce.model.AbstractBceRequest
getRequestCredentials, setRequestCredentials
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CreateFunctionRequest

public CreateFunctionRequest(String functionName,
                             String description)
Method Detail

getCode

public Code getCode()
Get the function code

Returns:
The function code

setCode

public void setCode(Code code)
Set the function code

Parameters:
code - The function code

getEnvironment

public Environment getEnvironment()
Get the function environment

Returns:
The function environment

setEnvironment

public void setEnvironment(Environment environment)
Set the function environment

Parameters:
environment - The function environment

getHandler

public String getHandler()
Get the entry function of CFC call.

Returns:
The entry function of CFC call

setHandler

public void setHandler(String handler)
Set the entry function of CFC call. For node is module-name.export eg. index.handler maximum length limit is 128

Parameters:
handler - The entry function of CFC call. For node is module-name.export eg. index.handler maximum length limit is 128.

getMemorySize

public Integer getMemorySize()
Get the memory siz.

Returns:
The memory size

setMemorySize

public void setMemorySize(Integer memorySize)
Set the memory size. in megabytes, used by CFC to infer the amount of CPU and memory allocated to user functions. Default 128MB,Must be a multiple of 128MB (now CFC provides 128 to 1024M of memory).

Parameters:
memorySize - The memory size

getRuntime

public String getRuntime()
Get the runtime for function.

Returns:
The runtime for function

setRuntime

public void setRuntime(String runtime)
Set the runtime for function.

Parameters:
runtime - The runtime for function

getTimeout

public Integer getTimeout()
Get the timeout for executing a function

Returns:
The timeout for executing a function

setTimeout

public void setTimeout(Integer timeout)
Set the timeout for executing a function. The timeout should be 1-300

Parameters:
timeout - The timeout for executing a function

withFunctionName

public CreateFunctionRequest withFunctionName(String functionName)
Specified by:
withFunctionName in class GenericFunctionRequest

withDescription

public CreateFunctionRequest withDescription(String description)
Specified by:
withDescription in class GenericFunctionRequest

withCode

public CreateFunctionRequest withCode(Code code)

withEnvironment

public CreateFunctionRequest withEnvironment(Environment environment)

withHandler

public CreateFunctionRequest withHandler(String handler)

withMemorySize

public CreateFunctionRequest withMemorySize(Integer memorySize)

withRuntime

public CreateFunctionRequest withRuntime(String runtime)

withTimeout

public CreateFunctionRequest withTimeout(Integer timeout)

withRequestCredentials

public CreateFunctionRequest withRequestCredentials(BceCredentials credentials)
Specified by:
withRequestCredentials in class AbstractBceRequest

toString

public String toString()
(non-Javadoc)

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2020. All rights reserved.