メニュー

Expand
ページを評価:

Build

Builds are packages of Functions and Assets that you bundle together for deployment. Builds contain Function Version SIDs, Asset Version SIDs, and dependencies. Dependencies are Node.js packages from NPM.

Dependencies are defined as JSON strings, for example:

'[{"name": "randomcolor","version":"0.5.4" },
 {"name": "util","version":"0.10.3" },
 {"name": "xmldom","version":"0.1.27" },
 {"name": "got","version":"6.7.1" },
 {"name": "fs","version":"0.0.1-security" },
 {"name": "lodash","version":"4.17.11" },
 {"name": "date-fns","version":"1.30.1" }]'

Builds take time to package, deploy and be verified. After creating a build, it is best to poll every 1 second to check the build status. When a build is verified, it is ready to be used in a Deployment.

List of build statuses

Build Status

Meaning

Building Build request being processed by the packager.
completed We have run a health check on the uploaded package and verified it.
失敗 Packaging has failed at any of the above step.

Build properties

Resource Properties in REST API format
sid
sid<ZB> Not PII

The unique string that we created to identify the Build resource.

account_sid
sid<AC> Not PII

The SID of the Account that created the Build resource.

service_sid
sid<ZS> Not PII

The SID of the Service that the Build resource is associated with.

status
enum:status Not PII

The status of the Build. Can be: building, completed, or failed.

asset_versions
object[] Not PII

The list of Asset Version resource SIDs that are included in the Build.

function_versions
object[] Not PII

The list of Function Version resource SIDs that are included in the Build.

dependencies
object[] Not PII

A list of objects that describe the Dependencies included in the Build. Each object contains the name and version of the dependency.

runtime
enum:runtime Not PII

The Runtime version that will be used to run the Build resource when it is deployed.

date_created
date_time<iso8601> Not PII

The date and time in GMT when the Build resource was created specified in ISO 8601 format.

date_updated
date_time<iso8601> Not PII

The date and time in GMT when the Build resource was last updated specified in ISO 8601 format.

url
url Not PII

The absolute URL of the Build resource.

links
uri_map Not PII

Create a Build resource

post
https://serverless.twilio.com/v1/Services/{ServiceSid}/Builds
パラメーター
Parameters in REST API format
service_sid
Path
post sid_like<ZS> Not PII

The SID of the Service to create the Build resource under.

asset_versions
オプション
post sid<ZN>[] Not PII

The list of Asset Version resource SIDs to include in the Build.

function_versions
オプション
post sid<ZN>[] Not PII

The list of the Function Version resource SIDs to include in the Build.

dependencies
オプション
post 文字列 Not PII

A list of objects that describe the Dependencies included in the Build. Each object contains the name and version of the dependency.

runtime
オプション
post 文字列 Not PII

The Runtime version that will be used to run the Build resource when it is deployed.

例 1
        
        
        
        

        Fetch a Build resource

        GET
        https://serverless.twilio.com/v1/Services/{ServiceSid}/Builds/{Sid}
        パラメーター
        Parameters in REST API format
        service_sid
        Path
        GET sid_like<ZS> Not PII

        The SID of the Service to fetch the Build resource from.

        sid
        Path
        GET sid<ZB> Not PII

        The SID of the Build resource to fetch.

        例 1
              
              
              
              

              Read multiple Build resources

              GET
              https://serverless.twilio.com/v1/Services/{ServiceSid}/Builds
              パラメーター
              Parameters in REST API format
              service_sid
              Path
              GET sid_like<ZS> Not PII

              The SID of the Service to read the Build resources from.

              例 1
                    
                    
                    
                    

                    Delete a Build resource

                    削除する
                    https://serverless.twilio.com/v1/Services/{ServiceSid}/Builds/{Sid}
                    パラメーター
                    Parameters in REST API format
                    service_sid
                    Path
                    削除する sid_like<ZS> Not PII

                    The SID of the Service to delete the Build resource from.

                    sid
                    Path
                    削除する sid<ZB> Not PII

                    The SID of the Build resource to delete.

                    例 1
                          
                          
                          
                          
                          ページを評価:

                          ヘルプが必要ですか?

                          誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。

                                
                                
                                

                                フィードバックくださりありがとうございます!

                                We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

                                Sending your feedback...
                                🎉 Thank you for your feedback!
                                Something went wrong. Please try again.

                                Thanks for your feedback!

                                Refer us and get $10 in 3 simple steps!

                                ステップ1

                                Get link

                                Get a free personal referral link here

                                ステップ2:

                                Give $10

                                Your user signs up and upgrade using link

                                ステップ3

                                Get $10

                                1,250 free SMSes
                                OR 1,000 free voice mins
                                OR 12,000 chats
                                OR more