#Getrolloutstatusof`operations/rollouts.endpointsapis.appspot.com:canary-rollout`.$gcurlhttps://servicemanagement.googleapis.com/v1/operations/rollouts.endpointsapis.appspot.com:canary-rollout{"name":"operations/rollouts.endpointsapis.appspot.com:canary-rollout","metadata":{"@type":"type.googleapis.com/google.api.servicemanagement.v1.OperationMetadata","resourceNames":["services/endpointsapis.appspot.com/rollouts/canary-rollout"],"steps":[{"description":"update Service Controller","status":"DONE"}],"progressPercentage":100,"startTime":...},"done":true,"response":{"@type":"type.googleapis.com/google.api.servicemanagement.v1.Rollout","rolloutId":"canary-rollout","createTime":..."status":"SUCCESS","trafficPercentStrategy":{"percentages":{"old":90,"new":10,}},"serviceName":"endpointsapis.appspot.com"}}
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["# Managing Service Rollouts\n\nThis page describes how to use Service Infrastructure to perform a gradual\n[service configuration](/service-infrastructure/docs/glossary#config) [rollouts](/service-infrastructure/docs/glossary#rollout).\n\nUpdating the service configuration for a production service is risky and can\npotentially cause an outage. The Service Management API allows you to\ngradually roll out configuration changes, thus mitigating the impact caused\nby bad service configurations.\n\nYou can deploy multiple service configuration versions and\ndefine how these versions will be used at runtime, all through calling the\n[`services.rollouts.create`](/service-infrastructure/docs/service-management/reference/rest/v1/services.rollouts/create)\nmethod to initiate a\n[Rollout](/service-infrastructure/docs/service-management/reference/rest/v1/services.rollouts).\nAt most **5** service configurations can be rolled out at a time.\n\nBefore you begin\n----------------\n\nTo run the examples in this guide, make sure you first follow the instructions\nto complete the initial setup in\n[Getting Started with the Service Management API](/service-infrastructure/docs/service-management/getting-started).\n\nPerforming rollout\n------------------\n\nAssuming you have a [managed service](/service-infrastructure/docs/glossary#managed)\n`endpointsapis.appspot.com` built on the Service Management API, you can\nperform the following steps to roll out a service configuration change in a\nstaged and controlled manner.\n\nFor example, `endpointsapis.appspot.com` is currently using service\nconfiguration `old`, and you want to change it to use service configuration\n`new`. Instead of having the new service configuration instantaneously used by\nall production traffic, you can create a rollout to test the new service\nconfiguration with 10% of the total traffic: \n\n # Create rollout to test the new configuration with 10% traffic.\n $ gcurl -d '{\n \"rolloutId\": \"canary-rollout\",\n \"serviceName\": \"endpointsapis.appspot.com\",\n \"trafficPercentStrategy\": {\n \"percentages\": {\n \"new\": 10,\n \"old\": 90\n }\n }\n }' https://servicemanagement.googleapis.com/v1/services/endpointsapis.appspot.com/rollouts\n {\n \"name\": \"operations/rollouts.endpointsapis.appspot.com:canary-rollout\"\n \"metadata\": {\n \"@type\": \"type.googleapis.com/google.api.servicemanagement.v1.OperationMetadata\",\n \"resourceNames\": [\n \"services/endpointsapis.appspot.com/rollouts/canary-rollout\"\n ],\n \"startTime\": ...\n },\n \"response\": {\n \"@type\": \"type.googleapis.com/google.api.servicemanagement.v1.Rollout\",\n \"rolloutId\": \"canary-rollout\",\n \"createTime\": ...\n \"trafficPercentStrategy\": {\n \"percentages\": {\n \"old\": 90,\n \"new\": 10,\n }\n },\n \"serviceName\": \"endpointsapis.appspot.com\"\n }\n }\n\nAfter the rollout is created, you can then get the status of the rollout by\nrunning the following command, substituting your own rollout ID: \n\n # Get rollout status of `operations/rollouts.endpointsapis.appspot.com:canary-rollout`.\n $ gcurl https://servicemanagement.googleapis.com/v1/operations/rollouts.endpointsapis.appspot.com:canary-rollout\n {\n \"name\": \"operations/rollouts.endpointsapis.appspot.com:canary-rollout\",\n \"metadata\": {\n \"@type\": \"type.googleapis.com/google.api.servicemanagement.v1.OperationMetadata\",\n \"resourceNames\": [\n \"services/endpointsapis.appspot.com/rollouts/canary-rollout\"\n ],\n \"steps\": [\n {\n \"description\": \"update Service Controller\",\n \"status\": \"DONE\"\n }\n ],\n \"progressPercentage\": 100,\n \"startTime\": ...\n },\n \"done\": true,\n \"response\": {\n \"@type\": \"type.googleapis.com/google.api.servicemanagement.v1.Rollout\",\n \"rolloutId\": \"canary-rollout\",\n \"createTime\": ...\n \"status\": \"SUCCESS\",\n \"trafficPercentStrategy\": {\n \"percentages\": {\n \"old\": 90,\n \"new\": 10,\n }\n },\n \"serviceName\": \"endpointsapis.appspot.com\"\n }\n }\n\nAfter making sure the canary rollout has completed and the new service\nconfiguration is good, you can then create a rollout to let it serve 100% of the\ntraffic: \n\n # Create rollout to let new configuration serve 100% traffic.\n $ gcurl -d '{\n \"rolloutId\": \"full-rollout\",\n \"serviceName\": \"endpointsapis.appspot.com\",\n \"trafficPercentStrategy\": {\n \"percentages\": {\n \"new\": 100,\n }\n }\n }' https://servicemanagement.googleapis.com/v1/services/endpointsapis.appspot.com/rollouts\n {\n \"name\": \"operations/rollouts.endpointsapis.appspot.com:full-rollout\",\n \"metadata\": {\n \"@type\": \"type.googleapis.com/google.api.servicemanagement.v1.OperationMetadata\",\n \"resourceNames\": [\n \"services/endpointsapis.appspot.com/rollouts/full-rollout\"\n ],\n \"startTime\": ...\n },\n \"response\": {\n \"@type\": \"type.googleapis.com/google.api.servicemanagement.v1.Rollout\",\n \"rolloutId\": \"full-rollout\",\n \"createTime\": ...\n \"trafficPercentStrategy\": {\n \"percentages\": {\n \"new\": 100,\n }\n },\n \"serviceName\": \"endpointsapis.appspot.com\"\n }\n }\n\nIn case problems are observed during the test stage, you can roll back to the\nold configuration by doing: \n\n # Rollback to the old configuration.\n $ gcurl -d '{\n \"rolloutId\": \"rollout-to-old\",\n \"serviceName\": \"endpointsapis.appspot.com\",\n \"trafficPercentStrategy\": {\n \"percentages\": {\n \"old\": 100,\n }\n }\n }' https://servicemanagement.googleapis.com/v1/services/endpointsapis.appspot.com/rollouts\n {\n \"name\": \"operations/rollouts.endpointsapis.appspot.com:rollout-to-old\",\n \"metadata\": {\n \"@type\": \"type.googleapis.com/google.api.servicemanagement.v1.OperationMetadata\",\n \"resourceNames\": [\n \"services/endpointsapis.appspot.com/rollouts/rollout-to-old\"\n ],\n \"startTime\": ...\n },\n \"response\": {\n \"@type\": \"type.googleapis.com/google.api.servicemanagement.v1.Rollout\",\n \"rolloutId\": \"rollout-to-old\",\n \"createTime\": ...\n \"trafficPercentStrategy\": {\n \"percentages\": {\n \"old\": 100,\n }\n },\n \"serviceName\": \"endpointsapis.appspot.com\"\n }\n\n}\n\nViewing rollout history\n-----------------------\n\nThe Service Management API keeps a history of rollouts. To view the\nrollout history for `endpointsapis.appspot.com`, you can do: \n\n # List rollout history for `endpointsapis.appspot.com`.\n $ gcurl https://servicemanagement.googleapis.com/v1/services/endpointsapis.appspot.com/rollouts\n {\n \"rollouts\": [\n {\n \"rolloutId\": \"canary-rollout\",\n \"createTime\": ...\n \"status\": \"IN_PROGRESS\",\n \"trafficPercentStrategy\": {\n \"percentages\": {\n \"old\": 90,\n \"new\": 10\n }\n },\n \"serviceName\": \"endpointsapis.appspot.com\"\n },\n {\n \"rolloutId\": \"old-rollout\",\n \"createTime\": ...\n \"status\": \"SUCCESS\",\n \"trafficPercentStrategy\": {\n \"percentages\": {\n \"old\": 100\n }\n },\n \"serviceName\": \"endpointsapis.appspot.com\"\n },\n ...\n ]\n }"]]