Skip to content

Commit

Permalink
fix: adding base_uri in all calls to cover instances where viya calls…
Browse files Browse the repository at this point in the history
… are not on localhost
  • Loading branch information
vrh authored and vrh committed Sep 7, 2020
1 parent 58358c9 commit 3eae34d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions all.sas
Original file line number Diff line number Diff line change
Expand Up @@ -10603,7 +10603,7 @@ run;
libname &libref1 JSON fileref=&fname1;
data _null_;
set &libref1..links;
if rel='members' then call symputx('mref',quote(trim(href)),'l');
if rel='members' then call symputx('mref',quote("&base_uri"!!trim(href)),'l');
run;
/* get the children */
Expand Down Expand Up @@ -10633,7 +10633,7 @@ run;
%put NOTE:;%put NOTE- &sysmacroname: &path/&name NOT FOUND;%put NOTE- ;
%return;
%end;
proc http method="DELETE" url="&uri" &oauth_bearer;
proc http method="DELETE" url="&base_uri&uri" &oauth_bearer;
headers
%if &grant_type=authorization_code %then %do;
"Authorization"="Bearer &&&access_token_var"
Expand Down Expand Up @@ -10892,9 +10892,9 @@ libname &libref1 JSON fileref=&fname1;
data _null_;
set &libref1..links;
if rel='deleteRecursively' then
call symputx('href',quote(trim(href)),'l');
call symputx('href',quote("&base_uri"!!trim(href)),'l');
else if rel='members' then
call symputx('mref',quote(cats(href,'?recursive=true')),'l');
call symputx('mref',quote(cats("&base_uri",href,'?recursive=true')),'l');
run;
/* before we can delete the folder, we need to delete the children */
Expand All @@ -10915,7 +10915,7 @@ data _null_;
set &libref1a..items_links;
if href=:'/folders/folders' then return;
if rel='deleteResource' then
call execute('proc http method="DELETE" url='!!quote(trim(href))
call execute('proc http method="DELETE" url='!!quote("&base_uri"!!trim(href))
!!'; headers "Authorization"="Bearer &&&access_token_var" '
!!' "Accept"="*/*";run; /**/');
run;
Expand Down Expand Up @@ -11166,7 +11166,7 @@ options noquotelenmax;
%if "&root"="/" %then %do;
/* if root just list root folders */
proc http method='GET' out=&fname1 &oauth_bearer
url='%sysfunc(getoption(servicesbaseurl))/folders/rootFolders';
url="&base_uri/folders/rootFolders";
%if &grant_type=authorization_code %then %do;
headers "Authorization"="Bearer &&&access_token_var";
%end;
Expand All @@ -11189,7 +11189,7 @@ options noquotelenmax;
/* now get the followon link to list members */
data _null_;
set &libref1..links;
if rel='members' then call symputx('href',quote(trim(href)),'l');
if rel='members' then call symputx('href',quote("&base_uri"!!trim(href)),'l');
run;
%local fname2 libref2;
%let fname2=%mf_getuniquefileref();
Expand Down
2 changes: 1 addition & 1 deletion doxy/DoxygenLayout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<tab type="classmembers" visible="no" title="" intro=""/>
</tab>

<tab type="filelist" visible="yes" title="" intro="List of Files Used in the Macro Core Library"/>
<tab type="filelist" visible="yes" title="" intro="List of Files Used in the Macro-Core Library"/>

<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
Expand Down
4 changes: 2 additions & 2 deletions viya/mv_deletefoldermember.sas
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ run;
libname &libref1 JSON fileref=&fname1;
data _null_;
set &libref1..links;
if rel='members' then call symputx('mref',quote(trim(href)),'l');
if rel='members' then call symputx('mref',quote("&base_uri"!!trim(href)),'l');
run;

/* get the children */
Expand Down Expand Up @@ -128,7 +128,7 @@ run;
%put NOTE:;%put NOTE- &sysmacroname: &path/&name NOT FOUND;%put NOTE- ;
%return;
%end;
proc http method="DELETE" url="&uri" &oauth_bearer;
proc http method="DELETE" url="&base_uri&uri" &oauth_bearer;
headers
%if &grant_type=authorization_code %then %do;
"Authorization"="Bearer &&&access_token_var"
Expand Down
6 changes: 3 additions & 3 deletions viya/mv_deleteviyafolder.sas
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ libname &libref1 JSON fileref=&fname1;
data _null_;
set &libref1..links;
if rel='deleteRecursively' then
call symputx('href',quote(trim(href)),'l');
call symputx('href',quote("&base_uri"!!trim(href)),'l');
else if rel='members' then
call symputx('mref',quote(cats(href,'?recursive=true')),'l');
call symputx('mref',quote(cats("&base_uri",href,'?recursive=true')),'l');
run;

/* before we can delete the folder, we need to delete the children */
Expand All @@ -111,7 +111,7 @@ data _null_;
set &libref1a..items_links;
if href=:'/folders/folders' then return;
if rel='deleteResource' then
call execute('proc http method="DELETE" url='!!quote(trim(href))
call execute('proc http method="DELETE" url='!!quote("&base_uri"!!trim(href))
!!'; headers "Authorization"="Bearer &&&access_token_var" '
!!' "Accept"="*/*";run; /**/');
run;
Expand Down
4 changes: 2 additions & 2 deletions viya/mv_getfoldermembers.sas
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ options noquotelenmax;
%if "&root"="/" %then %do;
/* if root just list root folders */
proc http method='GET' out=&fname1 &oauth_bearer
url='%sysfunc(getoption(servicesbaseurl))/folders/rootFolders';
url="&base_uri/folders/rootFolders";
%if &grant_type=authorization_code %then %do;
headers "Authorization"="Bearer &&&access_token_var";
%end;
Expand All @@ -87,7 +87,7 @@ options noquotelenmax;
/* now get the followon link to list members */
data _null_;
set &libref1..links;
if rel='members' then call symputx('href',quote(trim(href)),'l');
if rel='members' then call symputx('href',quote("&base_uri"!!trim(href)),'l');
run;
%local fname2 libref2;
%let fname2=%mf_getuniquefileref();
Expand Down

0 comments on commit 3eae34d

Please sign in to comment.