Skip to content

Commit

Permalink
Merge pull request #165 from MZC-CSC/feature_tag_ali_20240704
Browse files Browse the repository at this point in the history
ALIBABA Dirver Tag handler feature
  • Loading branch information
SungWoongz authored Jul 24, 2024
2 parents e5b2b39 + 669f506 commit f6ff321
Show file tree
Hide file tree
Showing 16 changed files with 2,390 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,11 @@ <h2>Multi-Cloud Price Info</h2>
if (filterList) {
apiURL += ` -H 'Content-Type: application/json' -d '${filterList}'`
}
parent.frames["log_frame"].Log("curl -sX GET http://" + `${hostname}` + ":" + `${port}` + apiURL);
try {
parent.frames["log_frame"].Log("curl -sX GET http://" + `${hostname}` + ":" + `${port}` + apiURL);
} catch (e) {
// Do nothing if error occurs
}

let fetchText = 'fetching';
let intervalId = setInterval(() => {
Expand All @@ -333,17 +337,25 @@ <h2>Multi-Cloud Price Info</h2>
.then(data => {
clearInterval(intervalId); // stop the interval
fetchOverlayContent.srcdoc = data; // set the HTML content in the iframe

// logging the fetch success
parent.frames["log_frame"].Log(" ==> Fetch Success");

try {
// logging the fetch success
parent.frames["log_frame"].Log(" ==> Fetch Success");
} catch (e) {
// Do nothing if error occurs
}
})
.catch(error => {
console.error('Error:', error);
alert(error);
clearInterval(intervalId); // when error occurs, stop the interval

// logging the fetch error
parent.frames["log_frame"].Log(" ==> Fetch Error: " + error.message);
try {
// logging the fetch error
parent.frames["log_frame"].Log(" ==> Fetch Error: " + error.message);
} catch (e) {
// Do nothing if error occurs
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,7 @@ func (cloudConn *AlibabaCloudConnection) CreatePriceInfoHandler() (irs.PriceInfo
}

func (cloudConn *AlibabaCloudConnection) CreateTagHandler() (irs.TagHandler, error) {
return nil, errors.New("Alibaba Driver: not implemented")
cblogger.Info("Start")
handler := alirs.AlibabaTagHandler{cloudConn.Region, cloudConn.VMClient, cloudConn.Cs2015Client, cloudConn.VpcClient}
return &handler, nil
}
Loading

0 comments on commit f6ff321

Please sign in to comment.