REST API knowledge exchange
Post Reply
bou01
Influencer
Posts: 16
Liked: 1 time
Joined: Jun 30, 2022 7:45 am
Full Name: JP
Contact:

API add to job

Post by bou01 »

Hello everyone,

I have look the API of veeam but i have not found a API for my request.

It's possible in last version to add Linux machine (Agent) in a backup Job ?

Regards.
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: API add to job

Post by oleg.feoktistov »

Hi,

Not, it's not possible at the moment neither via VBR REST, nor via EM REST API.

Best regards,
Oleg
bou01
Influencer
Posts: 16
Liked: 1 time
Joined: Jun 30, 2022 7:45 am
Full Name: JP
Contact:

Re: API add to job

Post by bou01 »

thanks Oleg

What a pity !

With other, is possible to automate the installation and the configuration of Veeam Linux Agent in the machine ?
Powershell console , veemconfig, protection group with preinstalled Agent ?

My goal is to automate the installation and the configuration and manage the agent by the veeam server .

What is the best solution?
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: API add to job

Post by oleg.feoktistov »

Hi,

Yes, Powershell would be the best way to automate it. Have a look at Veeam Agent Management section of VBR Powershell reference. You are after cmdlets to manage protection groups and individual computers.

Let me know if you have any further questions on particular cmdlets or features.

Thanks,
Oleg
bou01
Influencer
Posts: 16
Liked: 1 time
Joined: Jun 30, 2022 7:45 am
Full Name: JP
Contact:

Re: API add to job

Post by bou01 »

Thanks
i have found a way

but It's possible to remove with powershell the last individual computers of a protection groups.
I have test add and remove but the last i can not remove-it

for remove it, i used:
Set-VBRProtectionGroup -ProtectionGroup $group -Container
the command require a "Container" it can not be empty

existing a solution ?
bou01
Influencer
Posts: 16
Liked: 1 time
Joined: Jun 30, 2022 7:45 am
Full Name: JP
Contact:

Re: API add to job

Post by bou01 »

In graphic interface you can remove a agent of the configuration
https://helpcenter.veeam.com/docs/backu ... ml?ver=110
but i have not found the PowerShell command for that
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: API add to job

Post by oleg.feoktistov »

In Powershell it works a bit differently. You need to get a protection group, its container and custom creds, filter out computers you want to remove, create a new array of custom creds without these computers, create a new container and pass it to the existing protection group. For example:

Code: Select all

$pg = Get-VBRProtectionGroup -Name 'ProtectionGroupName'
$container = $pg.Container
$customCreds = $container.CustomCredentials
$newCustomCreds = @()
foreach ($creds in $customCreds) {

    if ($creds.HostName -ne 'hostName') {
     $newCustomCreds += $creds
    }

}

$newContainer = New-VBRIndividualComputerContainer -CustomCredentials $newCustomCreds
Set-VBRProtectionGroup -ProtectionGroup $pg -Container $newContainer
Rescan-VBREntity -Entity $pg
And don't forget to rescan a protection group as the last step.

Best regards,
Oleg
bou01
Influencer
Posts: 16
Liked: 1 time
Joined: Jun 30, 2022 7:45 am
Full Name: JP
Contact:

Re: API add to job

Post by bou01 »

It's OK thanks a lot of Oleg for your help
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests