Skip to content

Commit f900b5d

Browse files
d-linkoDavid Linko
andauthored
Update submodules (#203)
* switching to latest commits * updated upload to look for yang not JSON * added missing table for ui users * fixing generaing ari with nested components * latest grafana panels * fixed aplication type for adm upload * removed ion-manager from status * added back adminer * added missing enviroment var for ion-agent3 * updated outfile to avoid conflict --------- Co-authored-by: David Linko <david.linko@jhuapl.edu>
1 parent 62dc15e commit f900b5d

File tree

23 files changed

+221
-81
lines changed

23 files changed

+221
-81
lines changed
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,2 @@
1-
[
2-
{
3-
"name": "UDP CL",
4-
"parameter": ["hostname", "port"],
5-
"command": [
6-
"ari:/IANA:ion_bp_admin/CTRL.outduct_add(\"udp\",\"<hostname>:<port>\",\"udpclo\", 0)",
7-
"ari:/IANA:ion_bp_admin/CTRL.outduct_start(\"udp\",\"<hostname>:<port>\")",
8-
"ari:/IANA:ion_bp_admin/CTRL.egress_plan_add(\"<eid>\", \"udp\", \"<hostname>:<port>\")",
9-
"ari:/IANA:ion_bp_admin/CTRL.egress_plan_start(\"<eid>\", \"<hostname>:<port>\")"
10-
]}
11-
]
1+
[]
122

anms-core/anms/routes/ARIs/reports.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ async def report_def_by_id(agent_id: str):
8181
correlator_nonce = res.correlator_nonce
8282
stmt = select(ExecutionSet).where(and_(ExecutionSet.agent_id == agent_id, ExecutionSet.correlator_nonce == correlator_nonce) )
8383
result: Result = await session.scalars(stmt)
84-
res = result.one_or_none()
85-
ari_val = ""
86-
if(res):
87-
ari_val = await transcoder.transcoder_put_cbor_await("ari:0x"+res.entries.hex())
88-
logger.info(ari_val)
89-
ari_val = ari_val['data']
90-
addition = {'exec_set': ari_val,'correlator_nonce':correlator_nonce}
91-
if addition not in final_res:
92-
final_res.append(addition)
84+
exc_set = result.all()
85+
for res in exc_set:
86+
ari_val = ""
87+
if(res):
88+
ari_val = await transcoder.transcoder_put_cbor_await("0x"+res.entries.hex())
89+
ari_val = ari_val['data']
90+
addition = {'exec_set': ari_val,'correlator_nonce':correlator_nonce}
91+
if addition not in final_res:
92+
final_res.append(addition)
9393

9494
return final_res
9595

@@ -122,7 +122,6 @@ async def report_ac(agent_id: str, correlator_nonce: int):
122122

123123
# current ARI should be an exection set
124124
if ari:
125-
logger.info(ari)
126125
if type(ari.value) == ace.ari.ExecutionSet:
127126
try:
128127
enc = ace.ari_text.Encoder()
@@ -166,7 +165,6 @@ async def report_ac(agent_id: str, correlator_nonce: int):
166165

167166
# current ARI should be an report set
168167
if ari:
169-
logger.info(ari)
170168
if type(ari.value) == ace.ari.ReportSet:
171169
for rpt in ari.value.reports:
172170
try:

anms-core/anms/routes/adms/adm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
AdmData = adm_data.AdmData
5757
DataModel = data_model_view.DataModel
5858

59-
ACCEPT_FILE_CONTENT_TYPE = "application/json"
59+
ACCEPT_FILE_CONTENT_TYPE = "application/octet-stream"
6060

6161

6262
class RequestError(BaseModel):

anms-core/anms/routes/system_status.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
{"name": "authnz", "url": "http://authnz/authn/login.html"},
5252
{"name": "grafana", "url": "http://grafana:3000"},
5353
{"name": "grafana-image-renderer", "url": "http://grafana-image-renderer:8081"},
54-
{"name": "ion-manager"},
5554
{"name": "amp-manager", "url": "http://amp-manager:8089/nm/api/version"},
5655
{"name": "mqtt-broker"},
5756
{"name": "postgres", "tcp_port": 5432},

anms-core/anms/routes/transcoder.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ async def transcoder_put_cbor_await(cbor: str):
9898
transcoder_log_id = None
9999
with get_session() as session:
100100
curr_uri = TranscoderLog.query.filter(or_(TranscoderLog.input_string==cbor, TranscoderLog.cbor==cbor)).first()
101-
102101
if curr_uri is None:
103102
c1 = TranscoderLog(input_string=cbor, parsed_as='pending')
104103
session.add(c1)

anms-ui/config_ui_env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ window.anms_env_config = {
2525
SERVICE_INFO: {
2626
names: [
2727
"adminer","anms-core","authnz",
28-
"ion-manager","aricodec","postgres",
28+
"aricodec","postgres",
2929
"redis","mqtt-broker","transcoder",
3030
"grafana","grafana-image-renderer"
3131
],

anms-ui/public/app/components/adm/Adm.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
</div>
3232
</template>
3333
<div class="d-flex justify-content-center mt-3">
34-
<b-button @click="getAdms" variant="info" size="sm">Get Adms</b-button>
34+
<b-button @click="getAdms" variant="info" size="sm">Get ADMs</b-button>
3535
</div>
3636
<div class="input-group mt-3 mb-3 justify-content-center">
3737
<div class="col-3"></div>
3838
<b-form-group class="custom-file col-3">
39-
<b-form-file v-model="file" id="adm" name="adm" accept=".json"></b-form-file>
39+
<b-form-file v-model="file" id="adm" name="adm" accept=".yang"></b-form-file>
4040
</b-form-group>
41-
<b-button @click="uploadAdms" variant="info" :disabled="!hasValidFile">Upload adm json</b-button>
41+
<b-button @click="uploadAdms" variant="info" :disabled="!hasValidFile">Upload ADM yang</b-button>
4242
<div class="col-3"></div>
4343
</div>
4444
<template v-if="hasRequestError">
@@ -81,7 +81,7 @@ export default {
8181
data() {
8282
return {
8383
file: null,
84-
allowUploadTypes: ["application/json"]
84+
allowUploadTypes: ["application/yang"]
8585
};
8686
},
8787
computed: {
@@ -103,7 +103,7 @@ export default {
103103
return this.adms.length > 0;
104104
},
105105
hasValidFile() {
106-
return (!_.isNull(this.file) && _.includes(this.allowUploadTypes, this.file.type));
106+
return (!_.isNull(this.file) );
107107
},
108108
},
109109
async mounted() {
@@ -136,9 +136,9 @@ export default {
136136
});
137137
},
138138
async uploadAdms() {
139-
let json_file = this.file;
139+
let yang_file = this.file;
140140
this.file = null;
141-
await this.uploadAdm(json_file);
141+
await this.uploadAdm(yang_file);
142142
if (!_.isNil(this.requestError) && this.requestError != "") {
143143
toastr.error(this.requestError);
144144
}

anms-ui/public/app/components/management/agents/reports.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
<script>
3535
import api from '../../../shared/api'
36+
import toastr from "toastr";
3637
3738
export default {
3839
name: "reports",
@@ -66,6 +67,7 @@ export default {
6667
// handle error
6768
console.error("reports error", error);
6869
console.info("error obj:", error);
70+
toastr.error("reports error: " + error)
6971
});
7072
7173
this.loading = false;

anms-ui/public/app/components/management/builder/ActionParameter.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<template>
22
<div>
3-
<label>{{name}}:</label>
4-
{{ count }}
3+
<label>{{name}}({{ type }}):</label>
54
<div>
65
<b-form-group>
76
<v-select v-model="ariKey"
@@ -86,7 +85,6 @@ export default {
8685
let value = result[0].value;
8786
let head = value.includes("ari") ? "" : "ari://";
8887
let realIndex = this.keysRealIndex[index];
89-
9088
this.currAc[realIndex] = head + value;
9189
this.submitAC();
9290
},
@@ -110,6 +108,7 @@ export default {
110108
}
111109
});
112110
this.currAc = currAc;
111+
113112
this.submitAC();
114113
},
115114
},

anms-ui/public/app/components/management/builder/ParameterView.vue

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export default {
8080
generateParameters() {
8181
parameter_builder.methods.genParms(this.ariKey, this.ARIs).then(response => {
8282
this.parameters = response[0];
83-
8483
this.description = response[1];
8584
this.finResult = response[2];
8685
this.finResultBase = this.finResult;
@@ -106,69 +105,72 @@ export default {
106105
107106
let testResult = [];
108107
if (this.ariKey.actual) {
109-
this.$emit("updateResult", [{ type: "/ARITYPE/OBJECT", value: this.ariKey.display }]);
108+
this.$emit("updateResult", [{ type: "OBJECT", value: this.ariKey.display }]);
110109
this.finResult = this.finResultBase;
111110
} else {
112111
this.finResult.forEach((element) => {
113112
let type = element["type"];
114113
let value = element["value"];
115114
let currValue = [];
116115
switch (type) {
117-
case "/ARITYPE/TEXTSTR":
118-
testResult.push(encodeURIComponent(JSON.stringify(value)));
116+
case "TEXTSTR":
117+
testResult.push(JSON.stringify(value));
119118
break;
120-
case "/ARITYPE/BYTESTR":
121-
testResult.push(encodeURIComponent(JSON.stringify(value)));
119+
case "BYTESTR":
120+
testResult.push(JSON.stringify(value));
122121
break;
123-
case "/ARITYPE/BYTE":
124-
testResult.push(encodeURIComponent(JSON.stringify(value)));
122+
case "BYTE":
123+
testResult.push(JSON.stringify(value));
125124
break;
126-
case "/ARITYPE/INT":
127-
testResult.push(encodeURIComponent(JSON.stringify(value).replaceAll('"', "")));
125+
case "INT":
126+
testResult.push(JSON.stringify(value).replaceAll('"', ""));
128127
break;
129-
case "/ARITYPE/UINT":
130-
testResult.push(encodeURIComponent(JSON.stringify(value).replaceAll('"', "")));
128+
case "UINT":
129+
testResult.push(JSON.stringify(value).replaceAll('"', ""));
131130
break;
132-
case "/ARITYPE/VAST":
133-
testResult.push(encodeURIComponent(JSON.stringify(value).replaceAll('"', "")));
131+
case "VAST":
132+
testResult.push(JSON.stringify(value).replaceAll('"', ""));
134133
break;
135-
case "/ARITYPE/UVAST":
134+
case "UVAST":
136135
testResult.push(
137-
encodeURIComponent(JSON.stringify(value).replaceAll('"', ""))
136+
JSON.stringify(value).replaceAll('"', "")
138137
);
139138
break;
140-
case "/ARITYPE/REAL32":
139+
case "REAL32":
141140
testResult.push(
142-
encodeURIComponent(JSON.stringify(value).replaceAll('"', ""))
141+
JSON.stringify(value).replaceAll('"', "")
143142
);
144143
break;
145-
case "/ARITYPE/REAL64":
144+
case "REAL64":
146145
testResult.push(
147-
encodeURIComponent(JSON.stringify(value).replaceAll('"', ""))
146+
JSON.stringify(value).replaceAll('"', "")
148147
);
149148
break;
150-
case "/ARITYPE/TP":
151-
testResult.push(encodeURIComponent(JSON.stringify(value).replaceAll('"', "")));
149+
case "TP":
150+
testResult.push(JSON.stringify(value).replaceAll('"', ""));
152151
break;
153-
case "/ARITYPE/TD":
154-
testResult.push(encodeURIComponent(JSON.stringify(value).replaceAll('"', "")));
152+
case "TD":
153+
testResult.push(JSON.stringify(value).replaceAll('"', ""));
155154
break;
156-
case "/ARITYPE//ARITYPE/OBJECT": //ari
155+
case "OBJECT": //ari
157156
let head = value.includes("ari:/") ? "" : "ari://";
158157
159158
testResult.push(JSON.stringify(head + value).replaceAll('"', ""));
160159
break;
161-
case "/ARITYPE/AC": //ac
162-
currValue = [];
160+
case "AC": //ac
161+
let curr_str= ""
162+
currValue = [];
163163
value.forEach((ari) => {
164-
currValue.push(ari.replaceAll('"', "'"));
164+
currValue.push(ari.replaceAll('"', ""));
165165
});
166-
167-
testResult.push(JSON.stringify(currValue).replaceAll('"', "").replaceAll("'",'"'));
168-
166+
if(currValue.length = 1 ){
167+
testResult.push(currValue[0])
168+
}else{
169+
testResult.push("/AC/("+currValue.join(",")+")");
170+
}
169171
break;
170172
171-
case "/ARITYPE/EXPR": //ac
173+
case "EXPR": //ac
172174
currValue = [];
173175
var parts = value.split("%")
174176
parts[1].split(',').forEach((ari) => {
@@ -180,8 +182,10 @@ export default {
180182
break;
181183
default:
182184
if (type.includes("TYPEDEF")){
183-
testResult.push(JSON.stringify(ari[0]));
184-
}else{testResult.push((JSON.stringify(value)));}
185+
testResult.push(value[0]);
186+
}else{
187+
188+
testResult.push((value));}
185189
186190
break;
187191
}
@@ -203,6 +207,8 @@ export default {
203207
// if using in agentModal adding ari:/EXECSET/ portion
204208
if(typeof this.nonce !== 'undefined'){
205209
// correlator_nonc
210+
// TODO currently random mayube make it increment or a choice
211+
// let nonce = Math.floor(Math.random() * 99999) + 1;
206212
this.finResultStr = "ari:/EXECSET/n=" + this.nonce + ";(" + this.finResultStr +")";
207213
}
208214
this.$emit("updateResult", [{ type: "ARI", value: this.finResultStr }]);

0 commit comments

Comments
 (0)