Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated backup/restore scripts. #855

Merged
merged 7 commits into from
Sep 1, 2020
Merged

Updated backup/restore scripts. #855

merged 7 commits into from
Sep 1, 2020

Conversation

azaslonov
Copy link
Member

No description provided.


async function getContentTypes() {
const data = await request(`https://${managementEndpoint}/contentTypes?api-version=2018-06-01-preview`);
const data = await request("GET", `https://${managementApiEndpoint}/contentTypes?api-version=2018-06-01-preview`, managementApiAccessToken);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the api version

const contentTypes = data.value.map(x => x.id.replace("\/contentTypes\/", ""));

return contentTypes;
}

async function getContentItems(contentType) {
const data = await request(`https://${managementEndpoint}/contentTypes/${contentType}/contentItems?api-version=2018-06-01-preview`);
const data = await request("GET", `https://${managementApiEndpoint}/contentTypes/${contentType}/contentItems?api-version=2018-06-01-preview`, managementApiAccessToken);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the api version


async function getContentTypes() {
const data = await request("GET", `https://${managementEndpoint}/contentTypes?api-version=2018-06-01-preview`);
const data = await request("GET", `https://${managementApiEndpoint}/contentTypes?api-version=2018-06-01-preview`, managementApiAccessToken);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the api version

const contentTypes = data.value.map(x => x.id.replace("\/contentTypes\/", ""));

return contentTypes;
}

async function getContentItems(contentType) {
const data = await request("GET", `https://${managementEndpoint}/contentTypes/${contentType}/contentItems?api-version=2018-06-01-preview`);
const data = await request("GET", `https://${managementApiEndpoint}/contentTypes/${contentType}/contentItems?api-version=2018-06-01-preview`, managementApiAccessToken);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the api version

@@ -87,46 +24,22 @@ async function deleteContent() {
const contentItems = await getContentItems(contentType);

for (const contentItem of contentItems) {
await request("DELETE", `https://${managementEndpoint}${contentItem.id}?api-version=2018-06-01-preview`);
await request("DELETE", `https://${managementApiEndpoint}${contentItem.id}?api-version=2018-06-01-preview`, managementApiAccessToken);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the api version

await request(`https://${managementEndpoint}${key}?api-version=2018-06-01-preview`, JSON.stringify(dataObj[key]));
await request(
"PUT",
`https://${managementApiEndpoint}${key}?api-version=2018-06-01-preview`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the api version

@azaslonov azaslonov merged commit 66af981 into master Sep 1, 2020
@azaslonov azaslonov deleted the az/scripts-update branch September 1, 2020 01:22
ygrik pushed a commit that referenced this pull request Apr 1, 2022
ygrik pushed a commit that referenced this pull request Apr 4, 2022
jsorohova pushed a commit that referenced this pull request Apr 14, 2022
maciejtreder pushed a commit that referenced this pull request Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants