032 bug fix 422 operation already started
This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@
|
||||
|
||||
//variables.framework.docs={};
|
||||
variables.framework.docs.APIName="Deck API";
|
||||
variables.framework.docs.APIVersion="0.031";
|
||||
variables.framework.docs.APIVersion="0.032";
|
||||
|
||||
variables.framework.globalHeaders = structNew();
|
||||
variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location";
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
<m:field>(select to_char(io.dt_finish, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') from instance_operation io where io.instance_uid=e.instance_uid order by dt_submit desc limit 1) as operation_dt_finish</m:field>
|
||||
<m:field>(select extract('epoch' from coalesce(io.dt_finish,CURRENT_TIMESTAMP)- io.dt_start) from instance_operation io where io.instance_uid=e.instance_uid order by dt_submit desc limit 1) as duration</m:field>
|
||||
<m:field>(select case when io.is_successful then extract('epoch' from CURRENT_TIMESTAMP - coalesce(io.dt_finish,CURRENT_TIMESTAMP)) else 0 end from instance_operation io where io.instance_uid=e.instance_uid order by dt_submit desc limit 1) as uptime</m:field>
|
||||
<m:field>(select io.dt_finish from instance_operation io where io.instance_uid=e.instance_uid AND io.is_successful AND io.operation='create' order by dt_submit desc limit 1) as dt_deploy</m:field>
|
||||
<!--- *** не то же самое, что в DETAIL view! --->
|
||||
<m:field formatter=#function(x){return (deserializeJson(x))}#>(select instance_data::text from instance_state st where st.instance_uid=e.instance_uid order by version desc limit 1) as instance_data</m:field><!--- *** операция выглядит очень накладно, но можно это поле в дельнейшем не выводить --->
|
||||
<m:field>(select st.instance_state_uid::text from instance_state st where st.instance_uid=e.instance_uid order by version desc limit 1) as instance_state_uid</m:field>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</cfquery> <!--- <cfdump var=#local.qCheckStarted.dt_finish#/><cfabort/> --->
|
||||
<cfif local.qCheckStarted.recordCount EQ 0>
|
||||
<cfreturn representationOf(this.helper.formatMessage("There is no configured instance operation with uid #arguments.instanceOperationUid#","Instance operation not found")).withStatus(404)/>
|
||||
<cfelseif left(local.qCheckStarted.submit_result,1) EQ "2" AND len(local.qCheckStarted.dt_finish EQ 0)><!--- 201 etc --->
|
||||
<cfelseif left(local.qCheckStarted.submit_result,1) EQ "2" AND len(local.qCheckStarted.dt_finish) EQ 0><!--- 201 etc --->
|
||||
<cfreturn representationOf(this.helper.formatMessage("Operation already started", "Parameter creation disabled for started operation")).withStatus(422)/>
|
||||
</cfif>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user