当前位置: 首页>>代码示例>>Python>>正文


Python Response.responseCode方法代码示例

本文整理汇总了Python中gen.apache.aurora.api.ttypes.Response.responseCode方法的典型用法代码示例。如果您正苦于以下问题:Python Response.responseCode方法的具体用法?Python Response.responseCode怎么用?Python Response.responseCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gen.apache.aurora.api.ttypes.Response的用法示例。


在下文中一共展示了Response.responseCode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_update_details_response

# 需要导入模块: from gen.apache.aurora.api.ttypes import Response [as 别名]
# 或者: from gen.apache.aurora.api.ttypes.Response import responseCode [as 别名]
 def get_update_details_response(cls):
     query_response = Response()
     query_response.responseCode = ResponseCode.OK
     query_response.result = Result()
     details = JobUpdateDetails(
         update=JobUpdate(
             summary=JobUpdateSummary(
                 key=UPDATE_KEY,
                 user="me",
                 state=JobUpdateState(
                     status=JobUpdateStatus.ROLLING_FORWARD, createdTimestampMs=1000, lastModifiedTimestampMs=2000
                 ),
             )
         ),
         updateEvents=[
             JobUpdateEvent(status=JobUpdateStatus.ROLLING_FORWARD, timestampMs=3000),
             JobUpdateEvent(
                 status=JobUpdateStatus.ROLL_FORWARD_PAUSED, message="Investigating issues", timestampMs=4000
             ),
             JobUpdateEvent(status=JobUpdateStatus.ROLLING_FORWARD, timestampMs=5000),
         ],
         instanceEvents=[
             JobInstanceUpdateEvent(instanceId=1, timestampMs=6000, action=JobUpdateAction.INSTANCE_UPDATING),
             JobInstanceUpdateEvent(instanceId=2, timestampMs=7000, action=JobUpdateAction.INSTANCE_UPDATING),
             JobInstanceUpdateEvent(instanceId=1, timestampMs=8000, action=JobUpdateAction.INSTANCE_UPDATED),
             JobInstanceUpdateEvent(instanceId=2, timestampMs=9000, action=JobUpdateAction.INSTANCE_UPDATED),
         ],
     )
     query_response.result.getJobUpdateDetailsResult = GetJobUpdateDetailsResult(details=details)
     return query_response
开发者ID:kidaa,项目名称:aurora,代码行数:32,代码来源:test_supdate.py

示例2: get_update_details_response

# 需要导入模块: from gen.apache.aurora.api.ttypes import Response [as 别名]
# 或者: from gen.apache.aurora.api.ttypes.Response import responseCode [as 别名]
 def get_update_details_response(cls):
     query_response = Response()
     query_response.responseCode = ResponseCode.OK
     query_response.result = Result()
     details = JobUpdateDetails()
     query_response.result.getJobUpdateDetailsResult = GetJobUpdateDetailsResult(details=details)
     details.update = JobUpdate()
     details.update.summary = JobUpdateSummary(
         jobKey=AuroraJobKey("west", "mcc", "test", "hello"),
         updateId="fake-update-identifier",
         user="me",
         state=JobUpdateState(
             status=JobUpdateStatus.ROLLING_FORWARD,
             createdTimestampMs=1411404927,
             lastModifiedTimestampMs=14114056030,
         ),
     )
     details.updateEvents = [
         JobUpdateEvent(status=JobUpdateStatus.ROLLING_FORWARD, timestampMs=1411404927),
         JobUpdateEvent(status=JobUpdateStatus.ROLL_FORWARD_PAUSED, timestampMs=1411405000),
         JobUpdateEvent(status=JobUpdateStatus.ROLLING_FORWARD, timestampMs=1411405100),
     ]
     details.instanceEvents = [
         JobInstanceUpdateEvent(instanceId=1, timestampMs=1411404930, action=JobUpdateAction.INSTANCE_UPDATING),
         JobInstanceUpdateEvent(instanceId=2, timestampMs=1411404940, action=JobUpdateAction.INSTANCE_UPDATING),
         JobInstanceUpdateEvent(instanceId=1, timestampMs=1411404950, action=JobUpdateAction.INSTANCE_UPDATED),
         JobInstanceUpdateEvent(instanceId=2, timestampMs=1411404960, action=JobUpdateAction.INSTANCE_UPDATED),
     ]
     return query_response
开发者ID:vrosnet,项目名称:incubator-aurora,代码行数:31,代码来源:test_supdate.py

示例3: get_status_query_response

# 需要导入模块: from gen.apache.aurora.api.ttypes import Response [as 别名]
# 或者: from gen.apache.aurora.api.ttypes.Response import responseCode [as 别名]
 def get_status_query_response(self, count=3):
   query_response = Response()
   query_response.responseCode = ResponseCode.OK
   query_response.result = Result()
   summaries = GetJobUpdateSummariesResult()
   query_response.result.getJobUpdateSummariesResult = summaries
   summaries.updateSummaries = [JobUpdateSummary(
       updateId="%s" % i,
       jobKey=self.TEST_JOBKEY.to_thrift(),
       user="me",
       state=JobUpdateState(
           status=JobUpdateStatus.ROLLED_FORWARD,
           createdTimestampMs=1411404927,
           lastModifiedTimestampMs=14114056030)) for i in range(count)]
   return query_response
开发者ID:dominichamon,项目名称:incubator-aurora,代码行数:17,代码来源:test_supdate.py

示例4: get_update_details_response

# 需要导入模块: from gen.apache.aurora.api.ttypes import Response [as 别名]
# 或者: from gen.apache.aurora.api.ttypes.Response import responseCode [as 别名]
 def get_update_details_response(self):
   query_response = Response()
   query_response.responseCode = ResponseCode.OK
   query_response.result = Result()
   details = JobUpdateDetails(
       update=JobUpdate(
           summary=JobUpdateSummary(
               jobKey=self.TEST_JOBKEY.to_thrift(),
               updateId="0",
               user="me",
               state=JobUpdateState(
                 status=JobUpdateStatus.ROLLING_FORWARD,
                 createdTimestampMs=1411404927,
                 lastModifiedTimestampMs=14114056030))),
       updateEvents=[
           JobUpdateEvent(
               status=JobUpdateStatus.ROLLING_FORWARD,
               timestampMs=1411404927),
           JobUpdateEvent(
               status=JobUpdateStatus.ROLL_FORWARD_PAUSED,
               timestampMs=1411405000),
           JobUpdateEvent(
               status=JobUpdateStatus.ROLLING_FORWARD,
               timestampMs=1411405100)],
       instanceEvents=[
           JobInstanceUpdateEvent(
               instanceId=1,
               timestampMs=1411404930,
               action=JobUpdateAction.INSTANCE_UPDATING),
           JobInstanceUpdateEvent(
               instanceId=2,
               timestampMs=1411404940,
               action=JobUpdateAction.INSTANCE_UPDATING),
           JobInstanceUpdateEvent(
               instanceId=1,
               timestampMs=1411404950,
               action=JobUpdateAction.INSTANCE_UPDATED),
           JobInstanceUpdateEvent(
               instanceId=2,
               timestampMs=1411404960,
               action=JobUpdateAction.INSTANCE_UPDATED)])
   query_response.result.getJobUpdateDetailsResult = GetJobUpdateDetailsResult(details=details)
   return query_response
开发者ID:dominichamon,项目名称:incubator-aurora,代码行数:45,代码来源:test_supdate.py

示例5: get_status_query_response

# 需要导入模块: from gen.apache.aurora.api.ttypes import Response [as 别名]
# 或者: from gen.apache.aurora.api.ttypes.Response import responseCode [as 别名]
 def get_status_query_response(cls):
     query_response = Response()
     query_response.responseCode = ResponseCode.OK
     query_response.result = Result()
     summaries = GetJobUpdateSummariesResult()
     query_response.result.getJobUpdateSummariesResult = summaries
     summaries.updateSummaries = [
         JobUpdateSummary(
             updateId="hello",
             jobKey=AuroraJobKey("west", "mcc", "test", "hello"),
             user="me",
             state=JobUpdateState(
                 status=JobUpdateStatus.ROLLING_FORWARD,
                 createdTimestampMs=1411404927,
                 lastModifiedTimestampMs=14114056030,
             ),
         ),
         JobUpdateSummary(
             updateId="goodbye",
             jobKey=AuroraJobKey("west", "mch", "prod", "goodbye"),
             user="me",
             state=JobUpdateState(
                 status=JobUpdateStatus.ROLLING_BACK,
                 createdTimestampMs=1411300632,
                 lastModifiedTimestampMs=14114092632,
             ),
         ),
         JobUpdateSummary(
             updateId="gasp",
             jobKey=AuroraJobKey("west", "mcq", "devel", "gasp"),
             user="me",
             state=JobUpdateState(
                 status=JobUpdateStatus.ROLL_FORWARD_PAUSED,
                 createdTimestampMs=1411600891,
                 lastModifiedTimestampMs=1411800891,
             ),
         ),
     ]
     return query_response
开发者ID:vrosnet,项目名称:incubator-aurora,代码行数:41,代码来源:test_supdate.py

示例6: get_status_query_response

# 需要导入模块: from gen.apache.aurora.api.ttypes import Response [as 别名]
# 或者: from gen.apache.aurora.api.ttypes.Response import responseCode [as 别名]
 def get_status_query_response(cls):
   query_response = Response()
   query_response.responseCode = ResponseCode.OK
   query_response.result = Result()
   summaries = GetJobUpdateSummariesResult()
   query_response.result.getJobUpdateSummariesResult = summaries
   summaries.updateSummaries = [
       JobUpdateSummary(
           updateId="hello",
           jobKey=AuroraJobKey('west', 'mcc', 'test', 'hello'), user="me",
           state=JobUpdateState(status=JobUpdateStatus.ROLLING_FORWARD,
               createdTimestampMs=1411404927, lastModifiedTimestampMs=14114056030)),
       JobUpdateSummary(
           updateId="goodbye",
           jobKey=AuroraJobKey('west', 'mch', 'prod', 'goodbye'), user="me",
           state=JobUpdateState(status=JobUpdateStatus.ROLLING_BACK,
               createdTimestampMs=1411300632, lastModifiedTimestampMs=14114092632)),
       JobUpdateSummary(
           updateId="gasp",
           jobKey=AuroraJobKey('west', 'mcq', 'devel', 'gasp'), user="me",
           state=JobUpdateState(status=JobUpdateStatus.ROLL_FORWARD_PAUSED,
               createdTimestampMs=1411600891, lastModifiedTimestampMs=1411800891))]
   return query_response
开发者ID:davelester,项目名称:incubator-aurora,代码行数:25,代码来源:test_supdate.py


注:本文中的gen.apache.aurora.api.ttypes.Response.responseCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。