Skip to content

Commit

Permalink
base v3.0 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
DumpySquare committed Jan 15, 2021
1 parent 01fe8fa commit cdcf1ed
Show file tree
Hide file tree
Showing 22 changed files with 1,751 additions and 1,097 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ out.old
# ignore directory that holds node_modules, these should be installed when npm installs the necessary packages from the package.json file
node_modules

# ignore ilx rpm cache directory
atc_ilx_rpm_cache
# ignore cache directory
cache

.vscode-test/
# ignore any extension install files and zips
*.vsix
Expand Down
4 changes: 3 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ vsc-extension-quickstart.md
**/*.map
**/*.ts
# **/*.gif
atc_ilx_rpm_cache/**

# ignore cache directory
cache/**
fastTemplateFolderUploadTemp/**
# ignore test seed file
.vscode-f5.json
Expand Down
16 changes: 16 additions & 0 deletions images/bigiq1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions images/bigiq_text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions images/greenCheck.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions images/greenDot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions images/orangeDot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 17 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,13 @@
"command": "f5.unInstallRPM",
"title": "Un-Install RPM",
"category": "F5",
"enablement": "f5.device"
"enablement": "f5.device && viewItem == atcService"
},
{
"command": "f5.createUCS",
"title": "Create UCS",
"category": "F5",
"enablement": "f5.device && viewItem == ucsHeader"
},
{
"command": "f5.refreshHostsTree",
Expand Down Expand Up @@ -911,6 +917,16 @@
"when": "view == f5Hosts && viewItem == f5Host",
"group": "inline"
},
{
"command": "f5.unInstallRPM",
"when": "view == f5Hosts && viewItem == atcService",
"group": "inline"
},
{
"command": "f5.createUCS",
"when": "view == f5Hosts && viewItem == ucsHeader",
"group": "inline"
},
{
"command": "f5.editHost",
"when": "view == f5Hosts && viewItem == f5Host"
Expand Down
104 changes: 52 additions & 52 deletions src/cfgExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,64 +11,64 @@ import logger from './utils/logger';



export async function getMiniUcs (): Promise<string|undefined> {

return await window.withProgress({
location: ProgressLocation.Notification,
title: `Getting Configuration from BIG-IP`,
cancellable: true
}, async (progress, token) => {
token.onCancellationRequested(() => {
// this logs but doesn't actually cancel...
logger.debug("User canceled External API Request");
return new Error(`User canceled External API Request`);
});

progress.report({ message: `Saving config on device`});
logger.debug('Saving config on F5 using bash api, "tmsh save sys config"');
// export async function getMiniUcs (): Promise<string|undefined> {

// return await window.withProgress({
// location: ProgressLocation.Notification,
// title: `Getting Configuration from BIG-IP`,
// cancellable: true
// }, async (progress, token) => {
// token.onCancellationRequested(() => {
// // this logs but doesn't actually cancel...
// logger.debug("User canceled External API Request");
// return new Error(`User canceled External API Request`);
// });

// progress.report({ message: `Saving config on device`});
// logger.debug('Saving config on F5 using bash api, "tmsh save sys config"');

// /**
// * save config before capturing mini_ucs!!!
// * over bash api: tmsh save sys config
// * or POST /mgmt/tm/sys/config { "command":"save" }
// */
await ext.mgmtClient?.makeRequest('/mgmt/tm/sys/config', {
method: 'POST',
body: {
command: 'save'
}
});
// // /**
// // * save config before capturing mini_ucs!!!
// // * over bash api: tmsh save sys config
// // * or POST /mgmt/tm/sys/config { "command":"save" }
// // */
// await ext.mgmtClient?.makeRequest('/mgmt/tm/sys/config', {
// method: 'POST',
// body: {
// command: 'save'
// }
// });


const tempFile = `mini_ucs.tar.gz`;
// const tempFile = `mini_ucs.tar.gz`;

progress.report({ message: `Collecting -> Downloading configs`});
// progress.report({ message: `Collecting -> Downloading configs`});

// build mini ucs
const ucsCmd = 'tar -czf /shared/images/${tempFile} /config/bigip.conf /config/bigip_base.conf /config/partitions';
logger.debug(`building mini_ucs on device with following command over bash api: ${ucsCmd}`);
await ext.mgmtClient?.makeRequest(`/mgmt/tm/util/bash`, {
method: 'POST',
body: {
command: 'run',
utilCmdArgs: `-c '${ucsCmd}'`
}
});
// // build mini ucs
// const ucsCmd = 'tar -czf /shared/images/${tempFile} /config/bigip.conf /config/bigip_base.conf /config/partitions';
// logger.debug(`building mini_ucs on device with following command over bash api: ${ucsCmd}`);
// await ext.mgmtClient?.makeRequest(`/mgmt/tm/util/bash`, {
// method: 'POST',
// body: {
// command: 'run',
// utilCmdArgs: `-c '${ucsCmd}'`
// }
// });

const coreDir = ext.context.extensionPath;
const zipDown = path.join(coreDir, tempFile);

try {
const resp = await ext.mgmtClient?.download(tempFile, zipDown);
logger.debug(`Should have downloaded new mini_ucs: ${zipDown}`);
return zipDown;
} catch (e) {
logger.error('mini_ucs download error', e.message);
return undefined;
}
});

}
// const coreDir = ext.context.extensionPath;
// const zipDown = path.join(coreDir, tempFile);

// try {
// const resp = await ext.mgmtClient?.download(tempFile, zipDown);
// logger.debug(`Should have downloaded new mini_ucs: ${zipDown}`);
// return zipDown;
// } catch (e) {
// logger.error('mini_ucs download error', e.message);
// return undefined;
// }
// });

// }

export async function makeExplosion (file: string) {

Expand Down
Loading

0 comments on commit cdcf1ed

Please sign in to comment.